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

Bug(let): status reports 'can fast-forward' when not true

From
Charles Bailey <charles@hashpling.org>
Date
Apr 21, 2009, 20:53 UTC
Message-ID
<20090421205352.GA29125@hashpling.org>

I was not really thinking when I get fetched, and ran git status on my pu branch. I was told that pu was behind origin/pu by 104 commits and could be fast-forwarded, so I git merged origin/pu and was mildly surprised when git merge made a commit for me.

A quick investigation revealed that pu had (of course) been rewound, but the only commits that it had that the new pu didn't, were merge commits.

I think that the problem is that in remote.c, a list of non-merge commits is generated for the status report. If it's non-zero, then it's the correct number of 'useful' commits to report, however if it is zero then this is not sufficient for a merge to fast-forward. The total number of commits unique to the local branch, including merges, must also be zero.

Is this a bug?
-- 
Charles Bailey
http://ccgi.hashpling.plus.com/blog/
Next: Jeff King
Message 1 of 4 in “Bug(let): status reports 'can fast-forward' when not true”
  1. Charles BaileyApr 21, 2009
  2. Jeff KingApr 21, 2009
  3. Junio C HamanoApr 21, 2009
  4. Kjetil BarvikApr 22, 2009

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.