Fossil Forum

Something really weird just happened with update/merge
Login

Something really weird just happened with update/merge

Something really weird just happened with update/merge

(1.3) By Stephan Beal (stephan) on 2020-08-16 16:22:03 edited from 1.2 [source]

i have no idea what just happened here with update and merging, but here's what my bash history and fallible short-term memory tells me...

(@Andy Goth: please read this! i may have crossed the streams with you!)

The trunk, as of this writing, looks like:

https://fossil.wanderinghorse.net/screenshots/fossil-merge-weirdness-2020-08-16.png

What led to that, as best as i can reconstruct it:

  • i was working on the line-number-section branch, unaware that Richard had merged it for 2.12.
  • Tried to commit and got a warning about a closed leaf.
  • Updated to trunk but got a conflict.
  • undo
  • Save stash
  • Update to trunk
  • Apply stash. Expected the conflict but didn't get one.
  • Tested and checked in. (Edit: nope - happened later.)
  • Did not notice that fossil moved me to the "bad-merge" branch, and i have no idea why it did that. i did not do update tip, only an unqualified "update" and "update trunk".

Here's where it gets unclear...

  • Tried to committed the first part of my stash.
  • It seems, looking at my history, that it failed, i stashed, updated, applied the stash, and committed again. That seems to have resulted in 2 commits: 154f6484 (in the "bad-merge" branch) and 2018954b (trunk).
  • Committed 2nd part of my stash (4368f529).
  • Looking at the timeline now, it looks like i may well have inadvertently checked in undesired changes from Andy G. from the bad-merge branch.

My current recommendation, but want to discuss it first, is to move:

https://fossil-scm.org/fossil/timeline?c=ea6365a8df6ab5fe&y=a

To a "mistake" branch and i'll re-commit my changes from its parent:

https://fossil-scm.org/fossil/timeline?c=9d2b7cab7ac64cf8&y=a

:-?

Edit: possibly nevermind. See the first response. It's still really weird, though.

(2) By Stephan Beal (stephan) on 2020-08-16 16:19:52 in reply to 1.0 [link] [source]

Looking at the timeline now, it looks like i may well have inadvertently checked in undesired changes from Andy G. from the bad-merge branch.

Or maybe not:

https://fossil-scm.org/fossil/info/4c16a24995b48fbb

is the start of that fork (which appears to be inadvertent) but it contains no changes.

(3) By Richard Hipp (drh) on 2020-08-16 16:23:44 in reply to 1.3 [link] [source]

See the wrong way to close a branch post for an explanation of what happened.

(4) By Stephan Beal (stephan) on 2020-08-16 16:24:54 in reply to 1.3 [link] [source]

Update: this is mostly explained in /forumpost/1477c7840b, but i'm still at a loss to explain why i was locally on bad-branch without having done an explicit update to tip.

(5) By Richard Hipp (drh) on 2020-08-16 16:39:52 in reply to 4 [link] [source]

Your check-out remembers the specific SHA3 hash that you have checked out, not the name of the branch. So when the check-in that you had checked out moved to the new branch, that moved your check-out with it.

(6) By Stephan Beal (stephan) on 2020-08-16 16:41:43 in reply to 5 [link] [source]

That makes perfect sense, and now i'm just surprised that it hasn't happened to me before.

(7) By Richard Hipp (drh) on 2020-08-16 16:44:19 in reply to 6 [link] [source]

Suggestions for how to improve the UX are welcomed.

I suppose clients could detect when they have been moved to a new branch an issue a warning....

(8) By Stephan Beal (stephan) on 2020-08-16 16:54:17 in reply to 7 [link] [source]

It's happened once in... 12.5-ish years... so it doesn't seem all that pressing. It happened due to the explicit move of the trunk, and moving a branch like that is a real rarity.