git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug(let): status reports 'can fast-forward' when not true
@ 2009-04-21 20:53 Charles Bailey
  2009-04-21 21:02 ` Jeff King
  0 siblings, 1 reply; 4+ messages in thread
From: Charles Bailey @ 2009-04-21 20:53 UTC (permalink / raw)
  To: git

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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug(let): status reports 'can fast-forward' when not true
  2009-04-21 20:53 Bug(let): status reports 'can fast-forward' when not true Charles Bailey
@ 2009-04-21 21:02 ` Jeff King
  2009-04-21 23:28   ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff King @ 2009-04-21 21:02 UTC (permalink / raw)
  To: Charles Bailey; +Cc: git, Kjetil Barvik

[cc'ing Kjetil, as this is a fallout of 19de5d6]

On Tue, Apr 21, 2009 at 09:53:52PM +0100, Charles Bailey wrote:

> 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 this is an unintended consequence of 19de5d6
(stat_tracking_info(): only count real commits, 2009-03-04). It is
perhaps more useful when seeing the actual numbers to see only the count
of real commits, but it makes statements like "can be fast-forwarded" no
longer true.

So I think we need to either:

  1. reword the "can be fast-forwarded" text to something else

  2. revert 19de5d6, since merge commits _can_ be interesting

  3. refactor stat_tracking_info to return "real" and "merge" counts,
     and change the text for the case of "real == 0 && merge > 0".

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug(let): status reports 'can fast-forward' when not true
  2009-04-21 21:02 ` Jeff King
@ 2009-04-21 23:28   ` Junio C Hamano
  2009-04-22  8:07     ` Kjetil Barvik
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2009-04-21 23:28 UTC (permalink / raw)
  To: Jeff King; +Cc: Charles Bailey, git, Kjetil Barvik

Jeff King <peff@peff.net> writes:

> [cc'ing Kjetil, as this is a fallout of 19de5d6]
>
> On Tue, Apr 21, 2009 at 09:53:52PM +0100, Charles Bailey wrote:
>
>> 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 this is an unintended consequence of 19de5d6
> (stat_tracking_info(): only count real commits, 2009-03-04). It is
> perhaps more useful when seeing the actual numbers to see only the count
> of real commits, but it makes statements like "can be fast-forwarded" no
> longer true.
>
> So I think we need to either:
>
>   1. reword the "can be fast-forwarded" text to something else
>
>   2. revert 19de5d6, since merge commits _can_ be interesting
>
>   3. refactor stat_tracking_info to return "real" and "merge" counts,
>      and change the text for the case of "real == 0 && merge > 0".
>
> -Peff

Let's revert it for now and then try #3 after 1.6.3 final.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug(let): status reports 'can fast-forward' when not true
  2009-04-21 23:28   ` Junio C Hamano
@ 2009-04-22  8:07     ` Kjetil Barvik
  0 siblings, 0 replies; 4+ messages in thread
From: Kjetil Barvik @ 2009-04-22  8:07 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, Charles Bailey, git

Junio C Hamano <gitster@pobox.com> writes:

> Jeff King <peff@peff.net> writes:
>
>> [cc'ing Kjetil, as this is a fallout of 19de5d6]
>>
>> On Tue, Apr 21, 2009 at 09:53:52PM +0100, Charles Bailey wrote:
>>
>>> 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 this is an unintended consequence of 19de5d6
>> (stat_tracking_info(): only count real commits, 2009-03-04). It is
>> perhaps more useful when seeing the actual numbers to see only the count
>> of real commits, but it makes statements like "can be fast-forwarded" no
>> longer true.
>>
>> So I think we need to either:
>>
>>   1. reword the "can be fast-forwarded" text to something else
>>
>>   2. revert 19de5d6, since merge commits _can_ be interesting
>>
>>   3. refactor stat_tracking_info to return "real" and "merge" counts,
>>      and change the text for the case of "real == 0 && merge > 0".
>>
>> -Peff
>
> Let's revert it for now and then try #3 after 1.6.3 final.

  OK.  

  Then I have some time thinking about a solution.  Maybe:

  4. Introduce an argument "--no-merges", and then only show real
     commits when used.

  -- kjetil

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-04-22  8:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-21 20:53 Bug(let): status reports 'can fast-forward' when not true Charles Bailey
2009-04-21 21:02 ` Jeff King
2009-04-21 23:28   ` Junio C Hamano
2009-04-22  8:07     ` Kjetil Barvik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).