Re: [PATCH 0/5] gitweb: Improve search code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 22 Jun 2011, Phil Hord wrote:
> On 06/22/2011 11:28 AM, Jakub Narebski wrote:

> > P.S. Another addition that I sometimes wanted git to have would be
                                                  ^^^

This is a typo: I actually wanted to say "gitweb" here.

Therefore this discussion is totally OFF-TOPIC now.

> > 'filename' or 'find' search: searching for file by name.
> >
> > What do you think of it?
> 
> I like it.  +1 from me.
> 
> I normally revert to 'git log --name-status | less <CR> /filename.foo',
> which is awful, of course.  I've always assumed there's a better way I
> haven't discovered yet.  But if there is, well... I haven't discovered
> it yet.
> 
> This syntax works on some files, but is limited and/or broken:
>    # Finds all commits touching the file named './foo.bar', iff
> ./foo.bar exists in the current commit.
>    git log -- foo.bar

Errr... if you use "git log foo.bar" it is true, but "git log -- foo.bar"
will find commits even if foo.bar existed only in the past... though
history simplification can make git return empty set.

> 
> I say 'broken', but maybe it's not; it feels like it is when I do this:
> 
>    # Returns zero logs
>    git log -- some-deleted-file.txt
> 
>    # Returns at least two logs
>    git log --all -- some-deleted-file.txt

     git log --full-history -- some-deleted-file.txt

For example in git.git repository:

   $ # git log --full-history --oneline -- gitweb.pl | cat
   2ad9331 v053
   185f09e v049
   ff7669a v048
   fbb592a v043
   [...]
   e0389bd v001
   ecb378f v000
   4c02e3c v000
   161332a first working version

(Don't you just love Kay Sievers commit messages ;-) ?).

> I think I understand why that happens (search optimization), but it is
> unexpected from the user's perspective.  I also suspect it will miss the
> 'pre-resurrection' commits for files which were deleted and resurrected
> in the past.
> 
> 
> What do you think of these as new 'Commit limiters' for git log:
> 
>        --name=<pattern>, --name-glob=<glob>
>            Limit the commits output to ones touching files that match the
>            specified pattern (regular expression) or glob (shell glob
>            pattern).

Why not use "git log --full-history -- '<glob>'" (i.e. remember about
shell escaping glob)?  I don't know if it works as intended in current
git or not...

-- 
Jakub Narebski
Poland
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]