Re: Git Commit Notes (fetching/pushing)

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

 



Hey Taylor. Thanks. Is there a way to configure the pushing of notes for ALL repositories? Basically, I'd like to configure this once (via my global Git configuration) and know that notes are being pushed and fetched across all repositories without having to configure each repository individually.

Originally, I was trying to use my test repository as a proving ground. I think I understand why only my notes were being pushed but not sure I understand why the default fetch and push refs were overwritten? I thought each fetch/push configuration entry was additive but I guess that's not the case?

Here's my complete local configuration in case it helps:

[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = https://github.com/bkuhlmann/test
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "main"]
remote = origin
merge = refs/heads/main
rebase = true

I was hoping to update the remote "origin" as:

[remote "origin"]
url = https://github.com/bkuhlmann/test
fetch = +refs/heads/*:refs/remotes/origin/*
        fetch = +refs/notes/*:refs/notes/*
        push = +refs/notes/*:refs/notes/*

...but the addition of the push configuration entry makes it impossible to push the feature branch up. Only the notes are pushed, like you said. ...but I'm missing the connection as to why default branch push behavior is being ignored/overwritten. I'm also failing to find documentation on why I can't create a branch, add some commits, add some notes, and then push all of these changes up (as well as fetch them back down again).

> On Aug 6, 2023, at 2:09 PM, Taylor Blau <me@xxxxxxxxxxxx> wrote:
> 
> 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