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

Re: On-branch topic description support?

From
Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Date
Jul 21, 2022, 20:19 UTC
Message-ID
<20220721201918.xvunkyehxnjbwhjv@meerkat.local>
In-Reply-To
<xmqqa692grqr.fsf@gitster.g>
On Thu, Jul 21, 2022 at 01:01:16PM -0700, Junio C Hamano wrote:
> Now you are discussing this on the git mailing list, you do not
> necessarily have to take the existing behaviour of Git as given.  

Indeed, I was mostly observing about how it works right now -- please don't take this as complaining. :)

Show 27 quoted lines
> For example, I do not think it is unreasonable to teach "git rebase
> [-i]" to special case a certain merge commit in the rebased range
> without any extra option, as long as the criteria to pick such a
> special "merge" is specific and narrow enough (a two-parent merge M
> whose tree matches that of one parent's tree (say M^1^{tree}), the
> other parent (say M^2) is an immediate ancestor of the bottommost
> commit of the range being rebased, or something like that).  And the
> way you "special case" it does not have to be tied to the way the
> "-r" option handles it, either.  
> 
> A possible design could go like this:
> 
>  * we recognize such a special merge commit;
> 
>  * we rebase the rest of the range, pretending as if that merge
>    commit did not exist and instead its children are all direct
>    child of one of its parent (say M^1), using the options given (so
>    "-r" would affect how other merges in the rebased range is
>    handled).
> 
>  * after everything is done, we create a new empty merge commit at
>    the top, merging the bottom of the range and the tip of the range
>    as its parents, using the log message from original M.  This can
>    be done totally outside of the regular "rebase" machinery.
> 
> Such a change to existing behaviour is well within the scope of
> "On-branch topic description support", I would think.

I agree, this would be great. If this is in place, then it would certainly bring us closer to managing "proposed change" series completely in-git.

One thought that comes to mind -- perhaps it would be easier not to track the special commit, but designate the branch as a special "proposed changes" branch that could even "hide" the cover-letter merge commit (CLM) from most operations. It's still a simple two-parent merge commit, so it can be pushed/pulled with any existing remotes without requiring any changes on the server side, but operations like adding a regular new commit to the tip of the "proposed changes" branch would automatically move the merge commit so it's back at the tip. This way "not sure what you're trying to do" situations like this would be avoided:

  A--B--C--CLM--D--E
 /          /
Y-----------
-K
Previous: Junio C HamanoNext: Junio C Hamano
Message 23 of 25 in “On-branch topic description support?”
  1. Junio C HamanoJul 20, 2022
  2. Shaoxuan YuanJul 21, 2022
  3. Elijah NewrenJul 21, 2022
  4. Junio C HamanoJul 21, 2022
  5. Konstantin RyabitsevJul 21, 2022
  6. Philip OakleyJul 21, 2022
  7. Junio C HamanoJul 21, 2022
  8. Junio C HamanoJul 21, 2022
  9. rsbecker@nexbridge.comJul 21, 2022
  10. Konstantin RyabitsevJul 21, 2022
  11. rsbecker@nexbridge.comJul 21, 2022
  12. Ævar Arnfjörð BjarmasonJul 21, 2022
  13. Konstantin RyabitsevJul 21, 2022
  14. Junio C HamanoJul 21, 2022
  15. Ævar Arnfjörð BjarmasonJul 21, 2022
  16. Junio C HamanoJul 21, 2022
  17. Ævar Arnfjörð BjarmasonJul 21, 2022
  18. Junio C HamanoJul 21, 2022
  19. Konstantin RyabitsevJul 21, 2022
  20. Ævar Arnfjörð BjarmasonJul 21, 2022
  21. Konstantin RyabitsevJul 21, 2022
  22. Junio C HamanoJul 21, 2022
  23. Konstantin RyabitsevJul 21, 2022
  24. Junio C HamanoJul 21, 2022
  25. Bagas SanjayaJul 22, 2022

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.