git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Possible git bug

From
WSWesley Schwengle <wesley@schwengle.net>
Date
Sep 16, 2021, 19:39 UTC
Message-ID
<3b4270f9-6139-7007-301b-8a084f4336cf@schwengle.net>
In-Reply-To
<xmqqzgsctu10.fsf@gitster.g>
On 9/16/21 11:33 AM, Junio C Hamano wrote:
Show 33 quoted lines
>> We are on a branch, we merge it into another branch.
>> We undo the merge because reasons.
>> Now we git rebase, without the upstream, because we've set it.
>> Fork-point is used now, because we haven't specified an upstream, but
>> we did set it and git merge-base decides, oh, we had those commits in
>> master but these where dropped so we drop them in this branch as well.
> 
> If you feel "It doesn't make sense to me", either
> 
>   - the behaviour does not make sense because it is simply buggy, in
>     which case, adding a sentence to the documentation and explaining
>     how not to use it is missing the point---don't you rather want it
>     to behave in a way that makes sense to you instead?
> 
> or
> 
>   - it appears as nonsense to you only because your understanding of
>     the behaviour is faulty but the feature is working correctly and
>     is not a bug, in which case, adding a sentence to the
>     documentation and explaining how not to use it is missing the
>     point---don't you rather want the existing documentation extended
>     to help you and other users to understand the behaviour better
>     first?
> 
> Between "buggy behaviour" and "bad documentation of a well-designed
> behaviour", I offhand do not know which side "--fork-point" is for
> this particular case, but I've always felt that it is a bad
> heuristic that should be used with care, and my gut feeling is it
> might be the third possibility: "bad heuristic that sometimes
> misbehave badly and that is unfixable".  If that is the case,
> perhaps the documentation should tell readers the unreliable nature
> of the option and warn them to double check the result before
> teaching them how to turn it off permanently.

I feel like it is a bad default, it caught me by surprise. Especially because in the reproduction path I wanted to explicit in my rebase action and this caused different behavior. After this was pointed out I read the man page because I thought `git rebase' and `git rebase master' was the same thing if that was configured as an upstream. It took me a while to figure this out, because I kept typing `git rebase' instead of `git rebase master' when quickly trying to find out why it wasn't behaving like it did earlier.

I'm clueless about "buggy behavior", "bad documentation of a well designed feature" or "bad heuristic that sometimes misbehave badly and that is unfixable". To me `git rebase' with a configured upstream should behave the same as `git rebase @{u}'. Only when adding --fork-point it should behave as it does currently. I'm not sure when I would want to use it, but I'm thinking people want it, otherwise it wouldn't be a default.

As for the patch. The reason why --fork-point is default I do not know, but how to disable it isn't documented and I think it should. It is hidden in the source code and the release notes of 2.31.0. It should be more visible. Which is the reason I submitted the patch.

Cheers, Wesley

-- 
Wesley Schwengle
E: wesley@schwengle.net
Previous: Junio C HamanoNext: Junio C Hamano
Message 18 of 20 in “Possible git bug”
  1. Wesley SchwengleSep 16, 2021
  2. Taylor BlauSep 16, 2021
  3. Wesley SchwengleSep 16, 2021
  4. wesley@schwengle.netSep 16, 2021
  5. Document `rebase.forkpoint` in rebase man pagewesley@schwengle.net, Sep 16, 2021
  6. Junio C HamanoSep 16, 2021
  7. Junio C HamanoSep 16, 2021
  8. wesley@schwengle.netSep 16, 2021
  9. Document `rebase.forkpoint` in rebase man pagewesley@schwengle.net, Sep 16, 2021
  10. Junio C HamanoSep 16, 2021
  11. Wesley SchwengleSep 16, 2021
  12. Junio C HamanoSep 16, 2021
  13. Wesley SchwengleSep 20, 2021
  14. wesley@schwengle.netSep 16, 2021
  15. Document `rebase.forkpoint` in rebase man pagewesley@schwengle.net, Sep 16, 2021
  16. Junio C HamanoSep 20, 2021
  17. Junio C HamanoSep 16, 2021
  18. Wesley SchwengleSep 16, 2021
  19. Junio C HamanoSep 16, 2021
  20. Wesley SchwengleSep 16, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.