937
you are viewing a single comment's thread
view the rest of the comments
[-] Everyday0764@lemmy.zip 28 points 4 days ago

in the projects i work in i always try to force semi linear history to avoid all of this, never merge (unless it's the MR) always rebase.

this leaves a very readable history, with each feature branch highlighted and no mixture in the commits...

i haven't found any downside yet... maybe that some ci/cd are built to push to main, but making them do branch pr automerge is not that difficult

[-] theneverfox@pawb.social 6 points 4 days ago

How does a rebase play out? I know what it is conceptually, but usually just do the difficult merges myself

[-] AnyOldName3@lemmy.world 11 points 4 days ago

Instead of git history, you get a git fairy tale. Practically, the merge conflicts and their resolutions get spread across one or more commits on the branch that was rebased, and the history makes it look like all the work was done after the upstream commit(s) that there was a conflict with. This can be much tidier, but also loses the context of changes. E.g. you can no longer see that something is done differently to everywhere else that does the same thing not because it needs to do it differently, but because it copied and pasted something from ten lines above and the thing ten lines above received a bug fix on another branch which the feature branch was rebased onto. Based on my experience working on large projects that used both approaches, I'd rather scroll past extra commits and squiggly branch lines than try to reconstruct what someone was thinking when they made a mistake without access to the original commit they made the mistake in. If I had to allow history-rewriting operations in git, the one I'd pick would be rewriting the history of Earth so that when history rewriting operations were implemented in git, they defaulted to adding some metadata to the rewritten commits making the operations reversible so I could decide I wanted the real history back.

[-] theneverfox@pawb.social 4 points 3 days ago

Having read through these replies, I'm leaning towards your thoughts on this. It does exactly what I thought it did, and I'm just not seeing the upside

I think I'm going to just push more strictly following feature branches

[-] Hudell@lemmy.dbzer0.com 2 points 3 days ago

The upside is that a beautiful lie is often preferred over an ugly truth.

load more comments (7 replies)
load more comments (8 replies)
this post was submitted on 09 Oct 2025
937 points (99.5% liked)

Programmer Humor

26859 readers
928 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS