News for hackers. Stuff that matters.
Re:Extremely Linear Git History by u801e on Tuesday November 22, 2022 @09:01AM (#33705839)
What I would like to see is a way to enforce fast-forward only merges along with the forced creation of a merge commit that references the same git tree as the HEAD commit of the branch that was just merged.

This way, you know which set of commits was in the branch by looking at the parent commits of the merge commit, but the merge commit itself did not involve any automated conflict resolution.

Re:Extremely Linear Git History by breatheoften on Tuesday November 22, 2022 @09:30AM (#33706158)
I've wanted this for awhile as well. Squash only merges, which are enforceable in github, get you close but leave you without any automated way to determine if a given branch was ever merged to main or not ... it's pretty annoying that such a mainstream workflow has such an obvious yet non-resolvable flaw ...
Re:Extremely Linear Git History by cerved on Tuesday November 22, 2022 @04:32PM (#33711807)
merge is the only way to reliable determine if a branch is merged ¯ \ _ ( ツ ) _ / ¯
Re:Extremely Linear Git History by wnoise on Tuesday November 22, 2022 @01:40PM (#33709325)
Yes, it is a shame that you can't combine git merge --ff-only --no-ff .
Re:Extremely Linear Git History by cerved on Tuesday November 22, 2022 @04:31PM (#33711787)
git rebase && git merge --no--ff
Re:Extremely Linear Git History by wnoise on Tuesday November 22, 2022 @07:05PM (#33713302)
(a) Because rebase is run on the branch to be rebased, but merge is run on the branch being merged to, that reverses the parents of the merge commit and puts it on the rebased branch rather than the parent. (b) Even if that were fixed, it alters the rebased branch, rather than stopping and warning in an unexpected case.

I really do want the natural semantics of merge --ff-only --no-ff.

Re:Extremely Linear Git History by cerved on Wednesday November 23, 2022 @02:22AM (#33716195)
you can do this

git rebase -r target source && git checkout target && git merge --no-ff target

since what your asking for is not a merge, you'd have glue it together by yourself. Perhaps, add it as a script