* unexpected behavior with `git log --skip filename`
@ 2011-10-07 17:15 Andrew McNabb
2011-10-07 21:54 ` Jay Soffian
0 siblings, 1 reply; 4+ messages in thread
From: Andrew McNabb @ 2011-10-07 17:15 UTC (permalink / raw)
To: git
The "--skip" option to "git log" did not behave as I expected, but I'm
not sure whether this was user error, unclear documentation, or a bug.
Specifically, I ran the following, intending to find the previous
revision of a given file:
git log --skip=1 -n 1 --oneline some-filename
My expectation was that this would behave the same as:
git log -n 2 --oneline some-filename |tail -n 1
Instead, the --skip=1 parameter seemed to be ignored. After I tried
several different values, it appears that the commits are skipped before
path matching with "some-filename".
Is this the intended behavior? If so, should the documentation be
clarified by changing "Note that they are applied before commit ordering
and formatting options, such as --reverse" to something like "Note that
they are applied before path matching, commit ordering, and formatting
options, such as --reverse"?
--
Andrew McNabb
http://www.mcnabbs.org/andrew/
PGP Fingerprint: 8A17 B57C 6879 1863 DE55 8012 AB4D 6098 8826 6868
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: unexpected behavior with `git log --skip filename`
2011-10-07 17:15 unexpected behavior with `git log --skip filename` Andrew McNabb
@ 2011-10-07 21:54 ` Jay Soffian
2011-10-08 2:36 ` Andrew McNabb
0 siblings, 1 reply; 4+ messages in thread
From: Jay Soffian @ 2011-10-07 21:54 UTC (permalink / raw)
To: Andrew McNabb; +Cc: git
On Fri, Oct 7, 2011 at 1:15 PM, Andrew McNabb <amcnabb@mcnabbs.org> wrote:
> The "--skip" option to "git log" did not behave as I expected, but I'm
> not sure whether this was user error, unclear documentation, or a bug.
> Specifically, I ran the following, intending to find the previous
> revision of a given file:
>
> git log --skip=1 -n 1 --oneline some-filename
>
> My expectation was that this would behave the same as:
>
> git log -n 2 --oneline some-filename |tail -n 1
>
> Instead, the --skip=1 parameter seemed to be ignored. After I tried
> several different values, it appears that the commits are skipped before
> path matching with "some-filename".
Hmm:
$ git log --oneline GIT-VERSION-GEN | head -2
7f41b6bbe3 Post 1.7.7 first wave
703f05ad58 Git 1.7.7
$ git log --oneline --skip=1 -n 1 GIT-VERSION-GEN
703f05ad58 Git 1.7.7
j.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: unexpected behavior with `git log --skip filename`
2011-10-07 21:54 ` Jay Soffian
@ 2011-10-08 2:36 ` Andrew McNabb
2011-10-08 17:47 ` Jay Soffian
0 siblings, 1 reply; 4+ messages in thread
From: Andrew McNabb @ 2011-10-08 2:36 UTC (permalink / raw)
To: Jay Soffian; +Cc: git
On Fri, Oct 07, 2011 at 05:54:36PM -0400, Jay Soffian wrote:
>
> Hmm:
>
> $ git log --oneline GIT-VERSION-GEN | head -2
> 7f41b6bbe3 Post 1.7.7 first wave
> 703f05ad58 Git 1.7.7
>
> $ git log --oneline --skip=1 -n 1 GIT-VERSION-GEN
> 703f05ad58 Git 1.7.7
I went back to reproduce this, and I think I may have been using the
--follow option earlier. In my private repository, git log gives
identical output for the last two commits when I don't specify --skip:
$ git log -n 2 --oneline httpd.conf.orig
f0026e9 updated many of the *.orig files to the latest version
e57e840 moved the .orig files into place, too
$ git log --follow -n 2 --oneline httpd.conf.orig
f0026e9 updated many of the *.orig files to the latest version
e57e840 moved the .orig files into place, too
$
But when I specify --skip=1, the output is different:
$ git log -n 1 --skip=1 --oneline httpd.conf.orig
e57e840 moved the .orig files into place, too
$ git log --follow -n 1 --skip=1 --oneline httpd.conf.orig
f0026e9 updated many of the *.orig files to the latest version
$
GIT-VERSION-GEN example that you shared, I don't notice this difference.
It's not immediately obvious to me what's different between the two
examples.
--
Andrew McNabb
http://www.mcnabbs.org/andrew/
PGP Fingerprint: 8A17 B57C 6879 1863 DE55 8012 AB4D 6098 8826 6868
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: unexpected behavior with `git log --skip filename`
2011-10-08 2:36 ` Andrew McNabb
@ 2011-10-08 17:47 ` Jay Soffian
0 siblings, 0 replies; 4+ messages in thread
From: Jay Soffian @ 2011-10-08 17:47 UTC (permalink / raw)
To: Andrew McNabb; +Cc: git
On Fri, Oct 7, 2011 at 10:36 PM, Andrew McNabb <amcnabb@mcnabbs.org> wrote:
> I went back to reproduce this, and I think I may have been using the
> --follow option earlier.
--follow is, er, special. It doesn't combine well with other rev-list
options. You'll have to search this list for details. Sorry I can't
provide more info. :-(
j.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-10-08 17:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-07 17:15 unexpected behavior with `git log --skip filename` Andrew McNabb
2011-10-07 21:54 ` Jay Soffian
2011-10-08 2:36 ` Andrew McNabb
2011-10-08 17:47 ` Jay Soffian
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).