{"thread":{"id":"53884","subject":"Pushing tag from a partial clone","startedAt":"2020-07-20T11:44:39Z","lastAt":"2020-07-20T17:54:57Z","messageCount":4,"participants":["Son Luong Ngoc","Derrick Stolee","Jonathan Tan"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"401763","messageId":"0DEFACA7-9D30-4DB1-9FDF-3E63945FAAB3@gmail.com","threadId":"53884","inReplyTo":null,"subject":"Pushing tag from a partial clone","fromName":"Son Luong Ngoc","fromEmail":"sluongng@gmail.com","sentAt":"2020-07-20T11:44:35Z","receivedAt":"2020-07-20T11:44:39Z","isPatch":false,"sender":{"key":"sluongng@gmail.com","avatar":"https://avatars.githubusercontent.com/u/26684313?v=4"},"body":"Hi folks,\n\nAt $day_job, we are trying to push tags to a repo from a partial clone copy.\nHowever it seems like this push would requires the partial clone copy to download more objects?\nIs this intended?\n\nReproduce:\n\n\tmkdir repo && cd repo\n\tgit init\n\tgit remote add origin git@domain.com:path/repo.git\n\tgit fetch --filter=tree:0 --no-tags --prune origin <commit-id>\n\tgit sparse-checkout init --cone\n\tgit checkout --force <commit-id>\n\tgit tag -a sluongng-test -m \"Test push from partial clone\"\n\tgit push HEAD:refs/tags/sluongng-test\n\t<git starts to download objects>\n\nIdeally we would like to be able to push tag from a shallow + partial clone repo without \nhaving to download extra objects if possible.\nWe would like to keep the required repo to the absolute minimum.\n\tgit fetch --depth 1 --filter=tree:0 --no-tags --prune origin <commit-id>\n\nCreating and pushing tags should not require local repo to have trees/blobs in it?\n\nGit version: 2.27.0\n\nCheers,\nSon Luong."},{"id":"401764","messageId":"3e68d3a1-01e6-4ce3-eee1-bc9fb07a1825@gmail.com","threadId":"53884","inReplyTo":"0DEFACA7-9D30-4DB1-9FDF-3E63945FAAB3@gmail.com","subject":"Re: Pushing tag from a partial clone","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2020-07-20T12:18:11Z","receivedAt":"2020-07-20T12:18:15Z","isPatch":false,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 7/20/2020 7:44 AM, Son Luong Ngoc wrote:\n> Hi folks,\n> \n> At $day_job, we are trying to push tags to a repo from a partial clone copy.\n> However it seems like this push would requires the partial clone copy to download more objects?\n> Is this intended?\n> \n> Reproduce:\n> \n> \tmkdir repo && cd repo\n> \tgit init\n> \tgit remote add origin git@domain.com:path/repo.git\n> \tgit fetch --filter=tree:0 --no-tags --prune origin <commit-id>\n> \tgit sparse-checkout init --cone\n> \tgit checkout --force <commit-id>\n> \tgit tag -a sluongng-test -m \"Test push from partial clone\"\n> \tgit push HEAD:refs/tags/sluongng-test\n> \t<git starts to download objects>\n> \n> Ideally we would like to be able to push tag from a shallow + partial clone repo without \n> having to download extra objects if possible.\n> We would like to keep the required repo to the absolute minimum.\n> \tgit fetch --depth 1 --filter=tree:0 --no-tags --prune origin <commit-id>\n> \n> Creating and pushing tags should not require local repo to have trees/blobs in it?\n> \n> Git version: 2.27.0\n\nCould you try this again with 2.28.0-rc1? I think Jonathan\nTan added the \"no-fetch\" flag in more places since 2.27.0,\nand this might already be fixed.\n\nThanks,\n-Stolee\n\n"},{"id":"401765","messageId":"439C1CC1-50BB-4EA1-A8F0-04D66CA430AE@gmail.com","threadId":"53884","inReplyTo":"3e68d3a1-01e6-4ce3-eee1-bc9fb07a1825@gmail.com","subject":"Re: Pushing tag from a partial clone","fromName":"Son Luong Ngoc","fromEmail":"sluongng@gmail.com","sentAt":"2020-07-20T13:47:10Z","receivedAt":"2020-07-20T13:47:15Z","isPatch":false,"sender":{"key":"sluongng@gmail.com","avatar":"https://avatars.githubusercontent.com/u/26684313?v=4"},"body":"Hi,\n\n> On Jul 20, 2020, at 14:18, Derrick Stolee <stolee@gmail.com> wrote:\n> \n> On 7/20/2020 7:44 AM, Son Luong Ngoc wrote:\n>> Hi folks,\n>> \n>> At $day_job, we are trying to push tags to a repo from a partial clone copy.\n>> However it seems like this push would requires the partial clone copy to download more objects?\n>> Is this intended?\n>> \n>> Reproduce:\n>> \n>> \tmkdir repo && cd repo\n>> \tgit init\n>> \tgit remote add origin git@domain.com:path/repo.git\n>> \tgit fetch --filter=tree:0 --no-tags --prune origin <commit-id>\n>> \tgit sparse-checkout init --cone\n>> \tgit checkout --force <commit-id>\n>> \tgit tag -a sluongng-test -m \"Test push from partial clone\"\n>> \tgit push HEAD:refs/tags/sluongng-test\n>> \t<git starts to download objects>\n>> \n>> Ideally we would like to be able to push tag from a shallow + partial clone repo without \n>> having to download extra objects if possible.\n>> We would like to keep the required repo to the absolute minimum.\n>> \tgit fetch --depth 1 --filter=tree:0 --no-tags --prune origin <commit-id>\n>> \n>> Creating and pushing tags should not require local repo to have trees/blobs in it?\n>> \n>> Git version: 2.27.0\n> \n> Could you try this again with 2.28.0-rc1? I think Jonathan\n> Tan added the \"no-fetch\" flag in more places since 2.27.0,\n> and this might already be fixed.\n\nI just freshly compiled from 'next' branch:\n\n\t> git version\n\tgit version 2.28.0.rc1.139.gd6b33fda9d\n\nAnd the problem still occurring:\n\t> mkdir scalar\n\t> cd scalar\n\t> git init\n\tInitialized empty Git repository in /Users/sluongngoc/work/booking/core/scalar/.git/\n\t# use my own fork here so that i have push permission\n\t> git remote add origin git@github.com:sluongng/scalar.git\n\t> git sparse-checkout init --cone\n\t> git fetch --filter=tree:0 --no-tags --prune origin 4ba6c1c090e6e5a413e3ac2fc094205bd78f761e\n\tremote: Enumerating objects: 2553, done.\n\tremote: Total 2553 (delta 0), reused 0 (delta 0), pack-reused 2553\n\tReceiving objects: 100% (2553/2553), 957.85 KiB | 1.06 MiB/s, done.\n\tResolving deltas: 100% (74/74), done.\n\tFrom github.com:sluongng/scalar\n\t * branch            4ba6c1c090e6e5a413e3ac2fc094205bd78f761e -> FETCH_HEAD\n\t> git tag -a test-tag -m 'test tag message' 4ba6c1c090e6e5a413e3ac2fc094205bd78f761e\n\t> git push origin refs/tags/test-tag:refs/tags/test-tag\n\t...<download start>\n\n> \n> Thanks,\n> -Stolee\n> \n\nThanks,\nSon Luong."},{"id":"401775","messageId":"20200720175449.1727314-1-jonathantanmy@google.com","threadId":"53884","inReplyTo":"439C1CC1-50BB-4EA1-A8F0-04D66CA430AE@gmail.com","subject":"Re: Pushing tag from a partial clone","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2020-07-20T17:54:49Z","receivedAt":"2020-07-20T17:54:57Z","isPatch":false,"sender":{"key":"jonathantanmy@fastmail.com","avatar":null},"body":"> I just freshly compiled from 'next' branch:\n> \n> \t> git version\n> \tgit version 2.28.0.rc1.139.gd6b33fda9d\n> \n> And the problem still occurring:\n> \t> mkdir scalar\n> \t> cd scalar\n> \t> git init\n> \tInitialized empty Git repository in /Users/sluongngoc/work/booking/core/scalar/.git/\n> \t# use my own fork here so that i have push permission\n> \t> git remote add origin git@github.com:sluongng/scalar.git\n> \t> git sparse-checkout init --cone\n> \t> git fetch --filter=tree:0 --no-tags --prune origin 4ba6c1c090e6e5a413e3ac2fc094205bd78f761e\n> \tremote: Enumerating objects: 2553, done.\n> \tremote: Total 2553 (delta 0), reused 0 (delta 0), pack-reused 2553\n> \tReceiving objects: 100% (2553/2553), 957.85 KiB | 1.06 MiB/s, done.\n> \tResolving deltas: 100% (74/74), done.\n> \tFrom github.com:sluongng/scalar\n> \t * branch            4ba6c1c090e6e5a413e3ac2fc094205bd78f761e -> FETCH_HEAD\n> \t> git tag -a test-tag -m 'test tag message' 4ba6c1c090e6e5a413e3ac2fc094205bd78f761e\n> \t> git push origin refs/tags/test-tag:refs/tags/test-tag\n> \t...<download start>\n\nThanks for the reproduction steps. Is 4ba6c1c advertised as a ref by the\nremote? If not, what is probably happening is that the client doesn't\nrealize that the server already has 4ba6c1c, so the client needs to\nfetch 4ba6c1c's objects to send it to the server.\n\nI am planning to see if I can add batch prefetching to pack-objects to\nreduce the severity of similar situations (just one batch prefetch instead\nof many one-by-one fetches), although that would work better with a blob\nfilter instead of a tree filter.\n"}]}