git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug with rev-list --reverse?
@ 2013-04-18 10:17 Felipe Contreras
  2013-04-18 10:26 ` John Keeping
  2013-04-18 10:47 ` Peter Krefting
  0 siblings, 2 replies; 7+ messages in thread
From: Felipe Contreras @ 2013-04-18 10:17 UTC (permalink / raw)
  To: git

Hi,

If I do these:

% git log --oneline -1 v1.8.1.5^..v1.8.1.6
% git log --oneline --reverse -1 v1.8.1.5^..v1.8.1.6

I expect to get a different output, and not both showing v1.8.1.6.
Wouldn't you agree?

Cheers.

-- 
Felipe Contreras

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

* Re: Bug with rev-list --reverse?
  2013-04-18 10:17 Bug with rev-list --reverse? Felipe Contreras
@ 2013-04-18 10:26 ` John Keeping
  2013-04-18 11:15   ` Felipe Contreras
  2013-04-18 10:47 ` Peter Krefting
  1 sibling, 1 reply; 7+ messages in thread
From: John Keeping @ 2013-04-18 10:26 UTC (permalink / raw)
  To: Felipe Contreras; +Cc: git

On Thu, Apr 18, 2013 at 05:17:14AM -0500, Felipe Contreras wrote:
> If I do these:
> 
> % git log --oneline -1 v1.8.1.5^..v1.8.1.6
> % git log --oneline --reverse -1 v1.8.1.5^..v1.8.1.6
> 
> I expect to get a different output, and not both showing v1.8.1.6.
> Wouldn't you agree?

I expect to get the same output.  This is probably because I consider
--reverse to be an output filter.  So I expect to show the commits
"v1.8.1.5^..v1.8.1.6 -1" which selects a single commit and then show
that in reverse order.

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

* Re: Bug with rev-list --reverse?
  2013-04-18 10:17 Bug with rev-list --reverse? Felipe Contreras
  2013-04-18 10:26 ` John Keeping
@ 2013-04-18 10:47 ` Peter Krefting
  2013-04-18 11:18   ` Felipe Contreras
  1 sibling, 1 reply; 7+ messages in thread
From: Peter Krefting @ 2013-04-18 10:47 UTC (permalink / raw)
  To: Felipe Contreras; +Cc: Git Mailing List

Felipe Contreras:

> % git log --oneline -1 v1.8.1.5^..v1.8.1.6
> % git log --oneline --reverse -1 v1.8.1.5^..v1.8.1.6
>
> I expect to get a different output, and not both showing v1.8.1.6.
> Wouldn't you agree?

  Quoting the manual page:

  Commit Limiting
    Besides specifying a range of commits that should be listed using the special notations explained in the description, additional commit limiting may be applied. Note that they are applied before commit ordering and formatting options, such as --reverse.

Given that, I would expect the output to be the same.

-- 
\\// Peter - http://www.softwolves.pp.se/

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

* Re: Bug with rev-list --reverse?
  2013-04-18 10:26 ` John Keeping
@ 2013-04-18 11:15   ` Felipe Contreras
  0 siblings, 0 replies; 7+ messages in thread
From: Felipe Contreras @ 2013-04-18 11:15 UTC (permalink / raw)
  To: John Keeping; +Cc: git

On Thu, Apr 18, 2013 at 5:26 AM, John Keeping <john@keeping.me.uk> wrote:
> On Thu, Apr 18, 2013 at 05:17:14AM -0500, Felipe Contreras wrote:
>> If I do these:
>>
>> % git log --oneline -1 v1.8.1.5^..v1.8.1.6
>> % git log --oneline --reverse -1 v1.8.1.5^..v1.8.1.6
>>
>> I expect to get a different output, and not both showing v1.8.1.6.
>> Wouldn't you agree?
>
> I expect to get the same output.  This is probably because I consider
> --reverse to be an output filter.  So I expect to show the commits
> "v1.8.1.5^..v1.8.1.6 -1" which selects a single commit and then show
> that in reverse order.

How about this:

% git log --oneline --reverse --max-count=1 v1.8.1.5^..v1.8.1.6

In this case --max-count is acting as "start from the first commit
before the tip", not as "output a maximum of one commit". Given that
the name is max-count, I expect it to be the later.

And if max-count doesn't select a maximum of n commits, then what does?

-- 
Felipe Contreras

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

* Re: Bug with rev-list --reverse?
  2013-04-18 10:47 ` Peter Krefting
@ 2013-04-18 11:18   ` Felipe Contreras
  2013-04-18 14:25     ` Thomas Rast
  0 siblings, 1 reply; 7+ messages in thread
From: Felipe Contreras @ 2013-04-18 11:18 UTC (permalink / raw)
  To: Peter Krefting; +Cc: Git Mailing List

On Thu, Apr 18, 2013 at 5:47 AM, Peter Krefting <peter@softwolves.pp.se> wrote:

>> % git log --oneline -1 v1.8.1.5^..v1.8.1.6
>> % git log --oneline --reverse -1 v1.8.1.5^..v1.8.1.6
>>
>> I expect to get a different output, and not both showing v1.8.1.6.
>> Wouldn't you agree?
>
>
>  Quoting the manual page:
>
>  Commit Limiting
>    Besides specifying a range of commits that should be listed using the
> special notations explained in the description, additional commit limiting
> may be applied. Note that they are applied before commit ordering and
> formatting options, such as --reverse.
>
> Given that, I would expect the output to be the same.

If expectations were based on documentation, all one has to do is
document bugs, and there would be no bugs anymore :)

Code can be changed to fit more appropriately user expectations (which
are independent of documentation), and the documentation updated
accordingly.

-- 
Felipe Contreras

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

* Re: Bug with rev-list --reverse?
  2013-04-18 11:18   ` Felipe Contreras
@ 2013-04-18 14:25     ` Thomas Rast
  2013-04-18 17:25       ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Rast @ 2013-04-18 14:25 UTC (permalink / raw)
  To: Felipe Contreras; +Cc: Peter Krefting, Git Mailing List

Felipe Contreras <felipe.contreras@gmail.com> writes:

> On Thu, Apr 18, 2013 at 5:47 AM, Peter Krefting <peter@softwolves.pp.se> wrote:
>
>>> % git log --oneline -1 v1.8.1.5^..v1.8.1.6
>>> % git log --oneline --reverse -1 v1.8.1.5^..v1.8.1.6
>>>
>>> I expect to get a different output, and not both showing v1.8.1.6.
>>> Wouldn't you agree?
>>
>>
>>  Quoting the manual page:
>>
>>  Commit Limiting
>>    Besides specifying a range of commits that should be listed using the
>> special notations explained in the description, additional commit limiting
>> may be applied. Note that they are applied before commit ordering and
>> formatting options, such as --reverse.
>>
>> Given that, I would expect the output to be the same.
>
> If expectations were based on documentation, all one has to do is
> document bugs, and there would be no bugs anymore :)
>
> Code can be changed to fit more appropriately user expectations (which
> are independent of documentation), and the documentation updated
> accordingly.

It's been this way forever, and applies to rev-list where we can't just
break how options work (for fear of breaking scripts).

You could come up with a patch series that first starts emitting
warnings whenever the user asks for behavior that will change, and later
flips the default and removes the warning (the latter would be merged
for 2.0 or so).

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

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

* Re: Bug with rev-list --reverse?
  2013-04-18 14:25     ` Thomas Rast
@ 2013-04-18 17:25       ` Junio C Hamano
  0 siblings, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2013-04-18 17:25 UTC (permalink / raw)
  To: Thomas Rast; +Cc: Felipe Contreras, Peter Krefting, Git Mailing List

Thomas Rast <trast@inf.ethz.ch> writes:

> You could come up with a patch series that first starts emitting
> warnings whenever the user asks for behavior that will change, and later
> flips the default and removes the warning (the latter would be merged
> for 2.0 or so).

Please don't.  The fact that "reverse then count" mode may be useful
does not mean "count then show in reverse" mode does not have any
use. "git log --oneline --reverse -20" is a very valid way to ask
"what did I do recently" and get "you did this, that and then..." in
that order.

Adding a new option can be done anytime without any complex
transition plan.  You may want to introduce a --show-in-reverse
synonym to the current --reverse when you add the new mode of
reversing (--reverse-before-count?) so that eventually we won't have
to ask "which kind of reverse an unadorned --reverse option mean?"
by deprecating a plain "--reverse", though.

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

end of thread, other threads:[~2013-04-18 17:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-18 10:17 Bug with rev-list --reverse? Felipe Contreras
2013-04-18 10:26 ` John Keeping
2013-04-18 11:15   ` Felipe Contreras
2013-04-18 10:47 ` Peter Krefting
2013-04-18 11:18   ` Felipe Contreras
2013-04-18 14:25     ` Thomas Rast
2013-04-18 17:25       ` Junio C Hamano

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).