git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com>
To: "Jeff King" <peff@peff.net>
Cc: "Stephen P. Smith" <ishchis2@gmail.com>, git@vger.kernel.org
Subject: Re: Can a note be pushed to origin?
Date: Sat, 28 Sep 2024 11:52:45 +0200	[thread overview]
Message-ID: <ca632f1a-c41f-42b3-8f8d-4ef32fe18e33@app.fastmail.com> (raw)
In-Reply-To: <20240927041516.GA568026@coredump.intra.peff.net>

On Fri, Sep 27, 2024, at 06:15, Jeff King wrote:
> On Wed, Sep 25, 2024 at 05:29:30PM +0200, Kristoffer Haugsbakk wrote:
>
>> That will refuse to update if your own notes ever diverge from the
>> remote.  If you want to always overwrite your local notes with the
>> remote ones:
>
> There are some specialized strategies for merging notes (e.g., taking
> the union of lines). See the "merge" subcommand in git-notes(1).
>
> I don't recall ever really using it myself, and I don't think there's
> really any porcelain support, so you're on your own to invoke the merge.
> But I guess the use case would be something like:
>
>   # fetch their notes into a holding spot
>   git config remote.origin.fetch refs/notes/commits:refs/notes/origin/commits
>
>   # and then after every fetch, you merge if necessary. By default we're
>   # merging into our own "refs/notes/commits". And it should be OK to
>   # use the short "origin/commits" here, since notes-refs have their own
>   # special lookup rules. Though using the fully qualified refname is
>   # probably reasonable, too.
>   git fetch
>   git notes merge -s union origin/commits

git-notes(1) feels like the most “plumbing” command out of the “main
porcelain commands”. :) (of those that I use)

For my needs though it is high level enough since I mostly add notes to
my own commits. Certainly porcelain in that sense. I use it all the time
to add testing/general comments to my commits.

-- 
Kristoffer Haugsbakk

  reply	other threads:[~2024-09-28  9:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-25 12:25 Can a note be pushed to origin? Stephen P. Smith
2024-09-25 15:29 ` Kristoffer Haugsbakk
2024-09-27  4:15   ` Jeff King
2024-09-28  9:52     ` Kristoffer Haugsbakk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-09-25 12:29 Stephen Steves Linda Smith
2024-10-02  1:37 ` Carlisle T. Hamlin
2024-10-02  1:39   ` Carlisle T. Hamlin
2024-09-25 12:07 Stephen P. Smith

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=ca632f1a-c41f-42b3-8f8d-4ef32fe18e33@app.fastmail.com \
    --to=kristofferhaugsbakk@fastmail.com \
    --cc=git@vger.kernel.org \
    --cc=ishchis2@gmail.com \
    --cc=peff@peff.net \
    /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).