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

Re: [RFC/PATCH] log: add log.firstparent option

From
Jacob Keller <jacob.keller@gmail.com>
Date
Jul 24, 2015, 07:44 UTC
Message-ID
<CA+P7+xrmu-waa6OTg4f5Q_gcDbDz3d_5f7W1HfbmMHWyBSe3=A@mail.gmail.com>
In-Reply-To
<20150724073415.GD2111@peff.net>
On Fri, Jul 24, 2015 at 12:34 AM, Jeff King <peff@peff.net> wrote:
Show 38 quoted lines
> On Thu, Jul 23, 2015 at 11:07:58PM -0700, Jacob Keller wrote:
>
>> I think some projects definitely benefit from the first-parent setup,
>> and it could be valuable, but I do tend to agree with Junio here that
>> the mess is always helpful. If may be helpful if people's commit
>> messages on that mess are good, but generally those that don't take
>> the time to rebase local work and re-express the commit messages are
>> not going to leave insightful messages the first time. However, have
>> the ability to view history this way is still possibly valuable.
>
> I think a really simple example is something like:
>
>   1. somebody implements as feature. It needs to handle cases a, b, and
>      c, but it only handles case a. Therefore it is buggy.
>
>   2. During review, somebody notices case b, and a new commit is made to
>      fix it. Nobody notices case c.
>
>   3. The topic is merged.
>
>   4. Much later, somebody notices the system is buggy and hunts in the
>      history.
>
> In a "clean" history, the patches from steps 1 and 2 are squashed. While
> reading the history, you see only "implement feature X", and no mention
> of the bug and its fix. But even if the person writes a terrible commit
> message for step (2), even seeing it pulled out into its own diff shows
> the exact nature of the already-seen bug, and may make it more obvious
> to realize that case (c) is a problem.
>
> I realize that's kind of vague. Another way to think about it is: in a
> squashing workflow like git.git, any time you have to turn to the
> mailing list to read the original sequence of re-rolls, you would have
> been better off if that information were in git. That's a minority case,
> but I certainly have turned to it (in some cases, the "fix" from our
> step 2 above actually introduces the new bug, and it's nice to see the
> reasoning that went into it :) ).
>

Actually this and the GitHub workflow make sense to me. I am concerned like you are about what to do in the case for passing commits.. maybe just make the option turn it on only if no arguments are passed (ie: "git log") and clearly document that it does not enable the behavior for arbitrary commits? That would make it useful without being too confusing nor too magical. Though, it does mean if you do pass a commit and want it on you'd have to specify.. I certainly would find it more confusing to have it enabled if I pass an arbitrary commit.. Maybe not though, I am not 100% sure on that.

Show 7 quoted lines
> Not that I am advocating for git.git to move to such a workflow. I think
> on balance the "clean" history is nicer to work with. I am only arguing
> that keeping the messy history is not without value; there are some
> cases where it is nice to have (and we keep it in the list archive,
> which is a minor pain to access compared to git).
>
> -Peff

For projects which make this easier (pull request style) I think this is making more sense. I'm not sure exactly whether it would be best to only enable via "git log" with no parameters, but it does seem weird to turn this on and then accidentally get the behavior on a random commit log sequence.... Maybe it's not a huge deal either way though..

Regards, Jake

Previous: Jeff KingNext: Junio C Hamano
Message 23 of 32 in “log: add log.firstparent option”
  1. log: add log.firstparent optionJeff King, Jul 23, 2015
  2. Config variables and scripting // was Re: [RFC/PATCH] log: add log.firstparent optionDavid Aguilar, Jul 23, 2015
  3. Jeff KingJul 23, 2015
  4. Jeff KingJul 23, 2015
  5. Jacob KellerJul 23, 2015
  6. Jeff KingJul 23, 2015
  7. Jacob KellerJul 23, 2015
  8. Michael J GruberJul 23, 2015
  9. Jeff KingJul 23, 2015
  10. Junio C HamanoJul 23, 2015
  11. Stefan BellerJul 23, 2015
  12. Jeff KingJul 24, 2015
  13. Jacob KellerJul 24, 2015
  14. Jeff KingJul 24, 2015
  15. Junio C HamanoJul 24, 2015
  16. Jeff KingJul 25, 2015
  17. Jeff KingJul 25, 2015
  18. Junio C HamanoJul 25, 2015
  19. Jeff KingJul 27, 2015
  20. Junio C HamanoJul 23, 2015
  21. Jacob KellerJul 24, 2015
  22. Jeff KingJul 24, 2015
  23. Jacob KellerJul 24, 2015
  24. Junio C HamanoJul 24, 2015
  25. Jeff KingJul 24, 2015
  26. Jeff KingJul 24, 2015
  27. Jeff KingJul 24, 2015
  28. Junio C HamanoJul 24, 2015
  29. Jeff KingJul 25, 2015
  30. Junio C HamanoJul 25, 2015
  31. Jacob KellerJul 25, 2015
  32. Jeff KingJul 27, 2015

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.