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

Re: On-branch topic description support?

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jul 21, 2022, 14:53 UTC
Message-ID
<220721.86mtd2tqct.gmgdl@evledraar.gmail.com>
In-Reply-To
<xmqqilnr1hff.fsf@gitster.g>
On Wed, Jul 20 2022, Junio C Hamano wrote:
>  * When you are almost finished with the initial draft of your
>    topic, you'd write a cover letter, and record it as the log
>    message of an empty commit at the tip of the topic.

Isn't thu DAG topology of creating a merge that encompases the given range a more clear marker for this sort of thing?

	# Create a topic branch
	git checkout -b topic -t origin/master
	for f in A B C; do echo $f >$f && git add $f && git commit -m$f; done
	# I forget if there a way to make the porcelain do this, not this or --ff...
	git merge @{u}
        # ... that's better!
	git reset --hard $(echo My CL here | git commit-tree -p @{u} -p HEAD HEAD:)
To steal and amend a diagram from git-merge(1), we now have turned this:
              A---B---C topic
             / 
        X---Y
             \
              master
Into this:
              A---B---C---M topic
             / \         /
        X---Y   ---------
             \
              master
I vaguely recall having actually used this for something in the past.

I tried now with "git rebase --rebase-merges -i", and it supports it properly, i.e. I could re-arrange it so that it's:

              A---C---B---M topic
             / \         /
        X---Y   ---------
             \
              master

And it still gave me a merge commit whose parents were my branch tip, and my @{upstream}.

The advantage of doing it this way is that it's obvious from the topology what the lower bound of this "summary so far merge" is, with an empty commit on top it:

 A) isn't distinguishable from other uses of empty commits, but this
     merge structure is rather unusual, so it sets it apart.
 B) You don't know what the lower bound is if your @{upstream} ref
    moves.
    I could see it being useful to e.g. offer to update the CL if
    there's conflicts, or if upstream has integrated part of my commits.
Previous: rsbecker@nexbridge.comNext: Konstantin Ryabitsev
Message 12 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.