git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Bug with git merge-base and a packed ref

From
Stepan Kasal <kasal@ucw.cz>
Date
Oct 12, 2016, 10:37 UTC
Message-ID
<20161012103716.GA31533@ucw.cz>
Hello,

first, I observed a bug with git pull --rebase: if the remote branch got rebased and the loval branch was updated, pull tried to rebase the whole branch, not the local increment.

A reproducer would look like that

# in repo1: git checkout tmp cd .. git clone repo1 repo2 cd repo1 git rebase elsewhere tmp cd ../repo2 # edit git commit -a -m 'Another commit' git pull -r

The last command performs something like
   git rebase new-origin/tmp
instead of
   git rebase --onto new-origin/tmp old-origin/tmp
I'm using git version 2.10.1.windows.1

I tried to debug the issue: I found that the bug happens only at the very first pull after clone. I was able to reproduce it with git-pull.sh

The problem seems to be that command
  git merge-base --fork-point refs/remotes/origin/tmp refs/heads/tmp
returns nothing, because the refs are packed.
Could you please fix merge-base so that it understands packed refs?
Thanks,
  Stepan
Next: Jeff King
Message 1 of 6 in “Bug with git merge-base and a packed ref”
  1. Stepan KasalOct 12, 2016
  2. Jeff KingOct 12, 2016
  3. Stepan KasalOct 12, 2016
  4. merge-base: handle --fork-point without reflogJeff King, Oct 12, 2016
  5. Junio C HamanoOct 12, 2016
  6. Stepan KasalOct 13, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.