git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: Brooke Kuhlmann <brooke@alchemists.io>
Cc: git@vger.kernel.org
Subject: Re: Git Commit Notes (fetching/pushing)
Date: Sun, 6 Aug 2023 16:09:29 -0400	[thread overview]
Message-ID: <ZM/9+YyOAbWWXQtC@nand.local> (raw)
In-Reply-To: <D01976C3-4B91-464B-ACF0-78DFFB066747@alchemists.io>

On Sun, Aug 06, 2023 at 12:35:50PM -0600, Brooke Kuhlmann wrote:
> I'm noticing issues with GitHub and GitLab when fetching and pushing
> commit notes and wanted to know if there is a correct way to configure
> my Git configuration for working with these servers (or maybe notes
> aren't supported at al)?
>
> Here's my configuration:
>
> ```
> [notes]
>   rewriteRef = refs/notes/commits
>
> [remote "origin"]
>   fetch = +refs/notes/*:refs/notes/*
>   push = +refs/notes/*:refs/notes/*
> ```

It looks like your refspec may not be doing what you think it is.

Here, you set both the default fetch and push refspecs to
"+refs/notes/*:refs/notes/*" which means to update anything under
the "refs/notes" hierarchy on either side, even when the updates are not
fast forwards.

Since you overwrote the default refspec, you end up only pushing the
notes, which we see from the response that you got back from GitHub:

> remote: Resolving deltas: 100% (1/1), completed with 1 local object.
> To https://github.com/bkuhlmann/test
>    5811bd44c32b..0f2422597c5d  refs/notes/commits -> refs/notes/commits

Indeed, refs/notes/commits is updated on your bkuhlmann/test repository,
which I can fetch from:

    $ git remote add origin git@github.com:bkuhlmann/test.git
    $ git fetch origin 'refs/notes/*:refs/notes/*'
    remote: Enumerating objects: 41, done.
    remote: Counting objects: 100% (41/41), done.
    remote: Compressing objects: 100% (29/29), done.
    remote: Total 41 (delta 14), reused 34 (delta 7), pack-reused 0
    Unpacking objects: 100% (41/41), 4.66 KiB | 1.55 MiB/s, done.
    From github.com:bkuhlmann/test
     * [new ref]           refs/notes/commits -> refs/notes/commits

I suspect you want an additional refspec that gathers any branches or
tags that you want to push along with refs/notes/*.

Thanks,
Taylor

  reply	other threads:[~2023-08-06 20:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-06 18:35 Git Commit Notes (fetching/pushing) Brooke Kuhlmann
2023-08-06 20:09 ` Taylor Blau [this message]
2023-08-06 21:49   ` Brooke Kuhlmann
2023-08-07  1:07     ` Junio C Hamano
2023-08-07 14:02       ` Brooke Kuhlmann
2023-08-07 16:14         ` Junio C Hamano
2023-08-07 20:18           ` Brooke Kuhlmann

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=ZM/9+YyOAbWWXQtC@nand.local \
    --to=me@ttaylorr.com \
    --cc=brooke@alchemists.io \
    --cc=git@vger.kernel.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).