git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Phil Hord <hordp@cisco.com>
Cc: git@vger.kernel.org,
	"John 'Warthog9' Hawley" <warthog9@kernel.org>,
	admin@repo.or.cz
Subject: Re: [PATCH 0/5] gitweb: Improve search code
Date: Wed, 22 Jun 2011 20:00:03 +0200	[thread overview]
Message-ID: <201106222000.04854.jnareb@gmail.com> (raw)
In-Reply-To: <4E02220F.10800@cisco.com>

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

  reply	other threads:[~2011-06-22 18:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22 15:28 [PATCH 0/5] gitweb: Improve search code Jakub Narebski
2011-06-22 15:28 ` [PATCHv3 1/5] gitweb: 'pickaxe' and 'grep' features requires 'search' to be enabled Jakub Narebski
2011-06-22 15:28 ` [PATCH 2/5] gitweb: Check permissions first in git_search Jakub Narebski
2011-06-22 15:28 ` [PATCH 3/5] gitweb: Split body of git_search into subroutines Jakub Narebski
2011-06-22 15:28 ` [PATCH 4/5] gitweb: Clean up code in git_search_* subroutines Jakub Narebski
2011-06-22 15:28 ` [PATCH 5/5] gitweb: Make git_search_* subroutines render whole pages Jakub Narebski
2011-06-22 17:10 ` [PATCH 0/5] gitweb: Improve search code Phil Hord
2011-06-22 18:00   ` Jakub Narebski [this message]
2011-06-22 19:24     ` Phil Hord
2011-06-22 18:55 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201106222000.04854.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=admin@repo.or.cz \
    --cc=git@vger.kernel.org \
    --cc=hordp@cisco.com \
    --cc=warthog9@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).