git push --tags failed silently when attempting to push a large number of tags

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

 



# What did you do before the bug happened? (Steps to reproduce your issue)

I ran into this issue when trying to create a mirror of a repo with approximately 129,000 tags. I created a fresh clone of the existing remote (origin), created the new remote (new-remote), then pushed the main branch up to the new remote. (This initially failed with `fatal: pack exceeds maximum allowed size`, so I pushed the branch in chunks of 500 commits.) Here’s where things became strange:

```
$ git push new-remote --tags
```

That command ran without error but emitted no output, even with `--verbose`. The command `git push new-remote --refs/tags/\*` had the same result, as expected. No tags were pushed. I also tried `git push new-remote --follow-tags`, which failed after several hours due to a connection timeout.

I tried pushing some tags individually, and that worked fine. So did pushing up smaller subsets of tags:

```
# push all tags that start with the letter a
$ git push new-remote +refs/tags/a\*
# push all tags that start with the letter b
$ git push new-remote +refs/tags/b\*
...
```

Those worked fine, until I tried pushing up a subset with approximately 62,000 tags, which failed:

```
# push all 62,000 tags that start with the letter c
$ git push new-remote +refs/tags/c\*
Pushing to github.com:my-org/new-remote.git
remote: fatal error in commit_refs
To github.com:my-org/new-remote.git
 ! [remote rejected]         c1 -> c1 (failure)
 ! [remote rejected]         c2 -> c2 (failure)
```

As I understand it, the error message `fatal error in commit_refs` is generated by GitHub. I was able to push those tags up by splitting the subset further, so it seems that GitHub is rejecting pushes that contain too many tags/too much data at once. I was eventually able to push all of my tags up in this way.

So to sum up:

1. Trying to push 62,000 tags at once failed with the error `remote: fatal error in commit_refs`.
2. Trying to push 129,000 tags at once had no effect but did not trigger any error (or any output of any kind).

# What did you expect to happen? (Expected behavior)

Since `git push new-remote --tags` did not succeed in pushing my tags (presumably due to an unexpected response from the remote), it should exit with a non-zero status code and emit an error message.

It would also be helpful for `git push --verbose` to include more output, to better identify which step failed.

# What happened instead? (Actual behavior)

The `git push new-remote --tags` command did not push any tags, but returned with status 0 and did not emit any output to stdout or stderr.

# System info from `git bugreport`

git version:
git version 2.35.1
cpu: arm64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Darwin 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:46:32 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T6000 arm64
compiler info: clang: 13.0.0 (clang-1300.0.29.3)
libc info: no libc information available
$SHELL (typically, interactive shell): /bin/zsh






[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