From: Junio C Hamano <gitster@pobox.com>
To: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Cc: Bence Ferdinandy <bence@ferdinandy.com>, git@vger.kernel.org
Subject: Re: branch description as a note?
Date: Thu, 12 Dec 2024 10:39:37 +0900 [thread overview]
Message-ID: <xmqqa5d1he7a.fsf@gitster.g> (raw)
In-Reply-To: <sem23vxg5c3xc62wvy5qn6gvoh6hc6m75mx35zgwsdyw36oexm@ayfez6uqghtt> (Konstantin Ryabitsev's message of "Wed, 11 Dec 2024 12:37:35 -0500")
Konstantin Ryabitsev <konstantin@linuxfoundation.org> writes:
>> If this is about draft work, I would use an empty commit at the tip
>> of the branch.
>
> I think this was discussed a while back:
> https://lore.kernel.org/git/xmqqilnr1hff.fsf@gitster.g/
>
> I think it boiled down to having a merge commit at the tip that would indicate
> the base-commit of the WIP range. I still think it's an awesome idea if
> something like this was natively supported by git tools.
I suspect taht Bence misunderstood some assumptions behind the above
discussion, some of which might not match the use case he has with
his "branch descriptions".
So, forgetting Bence's "branch description" for a while, let's see
if we can summarize the assumptions the older discussion had.
1. We want to summarize what is on the branch, to help the reviewers
and also the original developers.
2. When the branch gets accepted to another branch that is higher
in the food chain (e.g., an individual developer has a topic to
improve a kernel driver for one specific hardware, the developer
describes what they did and give the branch to the driver
maintainer, and the topic gets merged to the driver's tree. The
resulting merge may not yet be in Linus's tree, but from the
original developer's point of view, the topic is "done" for
now), a merge commit will use the "summary" created above in the
messages of the merge commit.
3. Once that happens, as it is etched into the merge commit, you
cannot update the description anymore (unless you and your
maintainer arrange to discard the merge and take an updated
branch), and that limitation is acceptable.
The idea to use an empty commit is to make it easier to communicate
the "topic description" between the author and the maintainer.
During the development on the branch, the empty-commit that holds
the description can be updated using the common "rebase -i"
workflow. If the empty commit were at the tip of the branch[*], we
can teach "git merge B" (or "git pull") to notice that the topic
description is in the commit B at the tip of the branch, create a
merge with B~1 instead, and when recording the merge, offer the log
message of B to help the maintainer write the log message for the
merge commit. The e-mail based tools would need some changes (like
allowing "format-patch | am" pipeline to pass an empty commit), but
the principle is the same.
If Bence's "branch description" is for a use case where the
description need to be updated even after the branch gets
"concluded" by being merged to the upstream, that is not a use case
the topic description stored in an empty commit on branch we
discussed earlier would cover, I suspect, as the primary focus is to
make it easier to maintain in point 1. above, and finalize it in the
merge commit to describe what was merged in point 2. above.
[Footnote]
* IIRC, there were some who preferred to make the description empty
commit at the bottom of the series, and while it is possible to
arrange such layout, it makes the eventual "git merge B" a lot
more cumbersome (i.e. you'd need to rebase B onto the
maintainer's tree, except for the bottom of the branch, and use
the message from the now-discarded commit for the log message of
the merge commit), and it would force developer to rebase the
_entire_ branch every time they need to update the description.
So I strongly prefer "description at the tip" layout, but the
choice between bottom and tip does not affect the 3-point
assumptions above.
next prev parent reply other threads:[~2024-12-12 1:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-11 10:39 branch description as a note? Bence Ferdinandy
2024-12-11 16:11 ` Junio C Hamano
2024-12-11 17:37 ` Konstantin Ryabitsev
2024-12-11 22:11 ` Bence Ferdinandy
2024-12-12 1:39 ` Junio C Hamano [this message]
2024-12-12 2:30 ` Konstantin Ryabitsev
2024-12-11 21:57 ` Bence Ferdinandy
2024-12-12 1:00 ` Junio C Hamano
2024-12-12 10:48 ` Bence Ferdinandy
2024-12-11 17:34 ` Justin Tobler
2024-12-11 22:02 ` Bence Ferdinandy
2024-12-12 1:52 ` Junio C Hamano
2024-12-12 10:57 ` Bence Ferdinandy
2024-12-11 20:13 ` Kristoffer Haugsbakk
2024-12-11 22:07 ` Kristoffer Haugsbakk
2024-12-12 10:48 ` Oswald Buddenhagen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqa5d1he7a.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=bence@ferdinandy.com \
--cc=git@vger.kernel.org \
--cc=konstantin@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).