Re: Git Commit Notes (fetching/pushing)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx: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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux