From: Junio C Hamano <gitster@pobox.com>
To: sideshowbarker <mike@w3.org>
Cc: git@vger.kernel.org
Subject: Re: Problem: git Notes not discoverable (+proposed solutions)
Date: Tue, 03 Sep 2024 14:34:02 -0700 [thread overview]
Message-ID: <xmqq7cbsh16d.fsf@gitster.g> (raw)
In-Reply-To: <Zp89ntYaeFUumaTO@w3.org> (sideshowbarker's message of "Tue, 23 Jul 2024 14:20:30 +0900")
sideshowbarker <mike@w3.org> writes:
> ## Problem description
>
> When a project has added git Notes for its commits, git by default doesn’t
> automatically fetch the Notes; so, the Notes aren’t automatically discoverable
> to contributors who are using “git log” to read the project commit logs — and
> especially not discoverable to new contributors, or “casual” users of the logs.
>
> A user will see the Notes only if they _already_ know what git Notes are, and
> know that the project uses Notes, and the user knows how to get them.
>
> But the reality is: most users do not even know what git Notes are, and don’t
> know how to get them if they exist. So most people end up never seeing them.
And even if they did, they wouldn't know how to use them, so not
much is lost here.
Quite honestly, a project that uses notes in such a way that it is
essential to understand/utilize the history should reexamine its use
of notes and try to see if they can make its commits more useful
without relying on notes, I would think.
> I’d be 100% happy to do the work of writing a patch to implement a solution
> (a git behavior change) for this — if I could get confirmation that the git
> maintainers would actually be open to reviewing such a patch.
I've seen from time to time people ask "I am thinking of doing this;
will a patch be accepted? If so, I'll work on it." before showing
any work, and my response always has been:
(1) We don't know how useful and interesting your contribution would
be for our audience, until we see it; and
(2) If you truly believe in your work (find it useful, find writing
it fun, etc.), that should be incentive enough for you to work
on it, whether or not the result will land in my tree. You
should instead aim for something so brilliant that we would
come to you begging for your permission to include it in our
project.
> As far as what the change would be: I realize this has been brought up
> before — but it seems the obvious solutions are to “just” change git so:
>
> - Proposed solution #1: git auto-fetches all Notes when a repo is first cloned,
> and then auto re-fetches them again for every “git fetch” or“git pull”.
>
> I think that auto-fetching-of-Notes would ideally be the _default_ git
> behavior — but short of that, at least a new [notes] _option_ for enabling
> that behavior would help. That would seem somewhat more “approachable” to
> than “git config --add remote.origin.fetch '+refs/notes/*:refs/notes/*'”.
>
> - Proposed solution #2: git checks if a clone lacks Notes vs remote, and emits:
>
> > Your clone is behind the origin remote by N notes. To fetch the notes
> > from the origin remote, run “git fetch origin 'refs/notes/*:refs/notes/*'”
>
> Either way, I’d be very willing to put work myself into writing up a patch.
A much more light-weight alternative would be to add an example to
the tutorial to tweak the "remote.origin.fetch" refspec so that it
will also fetch notes.
But stepping back a bit, none of the above (including your two) may
practically be workable unless you limit the source of the notes to
the upstream, or something. If you add notes yourself after you
clone, and the upstream makes different changes to its notes,
reconciling the diverged history of the notes tree would not be so
pleasant. As a mechanism for the only publisher to publish
auxiliary pieces of information to cloners, notes is a very useful
mechanism, but for such a use case to be effective, the project
participants must understand when they are supposed to use the notes
read-only.
next prev parent reply other threads:[~2024-09-03 21:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-23 5:20 Problem: git Notes not discoverable (+proposed solutions) sideshowbarker
2024-09-03 1:06 ` Sean Allred
2024-09-04 20:03 ` Jacob Keller
2024-09-03 21:34 ` Junio C Hamano [this message]
2024-09-04 7:13 ` Michal Suchánek
2024-09-04 14:54 ` Junio C Hamano
2024-09-04 7:24 ` Kristoffer Haugsbakk
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=xmqq7cbsh16d.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=mike@w3.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).