Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pushing an annotated tag has slightly different behavior between isomorphic-git and Git #1900

Open
hhourani27 opened this issue Apr 18, 2024 · 1 comment

Comments

@hhourani27
Copy link

hhourani27 commented Apr 18, 2024

I encountered a strange behavior when pushing an annotated tag. Upon investigation, I noticed that isomorphic-git's behavior is slightly different than Git's. I'm not sure it's a bug or may cause bugs down the line. I'm posting this question, to check with you if that might be the case.

To reproduce

  1. Clone an empty repository
  2. Add a file, then git add and commit: create a first commit on main
  3. Push main
  4. Create an annotated tag : git tag -a v1.0 -m "add tag"
  5. Using isomorphic-git, push the tag
  const pushResult = await git.push({
    fs,
    http,
    dir: "<path to repo>",
    ref: "v1.0",
  });

Result

  • On the Git server, the tag seems to be correctly pushed
  • On my Git GUI (both VSCode's Git Graph and GitHub Desktop), a new "tag" is displayed called origin/refs/tags/v1.0^{} <= This is what ticked me off
    image
  • I looked at the .git folder, and isomorphic-git created a new ref at refs/remotes/origin/refs/tags/v1.0

Comparing with git push
Instead of calling git.push(), I ran the command git push origin v1.0

  • On my Git GUI, I did not see a new "tag"
    image
  • Git did not modify the .git folder, and did not add a new ref

Do you have an explanation for this discrepancy? Does it have any impact down the line with future commands? Would you recommend that I investigate further isomorphic-git's code?

Notes

  • I am using isomorphic-git 1.25.7 on Node
  • My Git version is 2.41.0.windows.1
@jcubic
Copy link
Contributor

jcubic commented Apr 18, 2024

I have no idea what to answer. But if you want to contribute and change this behavior to make it work like canonical git, you're welcome to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants