From: George Spelvin <hidden> Date: 2016-06-15 22:46:18
There's one more change that was suggested that I'd like to propose:
- Make "git grep" search the whole repository by default; include an
explicit "." path limiter to search only the current directory.
In addition to being more consistent with other commands like "git log",
this saves a lot of typing working in drivers/net/usb/ if the identifier
you're looking for is in include/. Typing the additional space-dot
is pretty trivial if you want the current directory only.
From: Nicolas Pitre <hidden> Date: 2016-06-15 22:46:18
On Fri, 27 Feb 2009, George Spelvin wrote:
There's one more change that was suggested that I'd like to propose:
- Make "git grep" search the whole repository by default; include an
explicit "." path limiter to search only the current directory.
Isn't that already the default?
[nico@xanadu git]$ git grep Alice
Documentation/gittutorial.txt:Suppose that Alice has started a new project with a git repository in
Documentation/gittutorial.txt:This creates a new directory "myrepo" containing a clone of Alice's
Documentation/gittutorial.txt:When he's ready, he tells Alice to pull changes from the repository
Documentation/gittutorial.txt:This merges the changes from Bob's "master" branch into Alice's
Documentation/gittutorial.txt:current branch. If Alice has made her own changes in the meantime,
Documentation/gittutorial.txt:Note that in general, Alice would want her local changes committed before
Documentation/gittutorial.txt:initiating this "pull". If Bob's work conflicts with what Alice did since
Documentation/gittutorial.txt:their histories forked, Alice will use her working tree and the index to
Documentation/gittutorial.txt:refuse to merge --- Alice will have to get rid of her local changes in
Documentation/gittutorial.txt:Alice can peek at what Bob did without merging first, using the "fetch"
Documentation/gittutorial.txt:command; this allows Alice to inspect what Bob did, using a special
Documentation/gittutorial.txt:This operation is safe even if Alice has uncommitted local changes.
Documentation/gittutorial.txt:Alice already knows everything that leads to her current state (HEAD),
Documentation/gittutorial.txt:If Alice wants to visualize what Bob did since their histories forked
Documentation/gittutorial.txt:Alice may want to view what both of them did since they forked.
Documentation/gittutorial.txt:After inspecting what Bob did, if there is nothing urgent, Alice may
Documentation/gittutorial.txt:does have something Alice would immediately need, Alice may choose to
Documentation/gittutorial.txt:With this, Alice can perform the first part of the "pull" operation alone using the
Documentation/gittutorial.txt:Unlike the longhand form, when Alice fetches from Bob using a
Documentation/gittutorial.txt:Alice's master branch.
Documentation/gittutorial.txt:After examining those changes, Alice
Documentation/gittutorial.txt:Later, Bob can update his repo with Alice's latest changes using
Documentation/gittutorial.txt:Note that he doesn't need to give the path to Alice's repository;
Documentation/gittutorial.txt:when Bob cloned Alice's repository, git stored the location of her
Documentation/gittutorial.txt:Git also keeps a pristine copy of Alice's master branch under the
t/t5519-push-alternates.sh: # Project Bob is a fork of project Alice
t/t5519-push-alternates.sh: # Bob acquires what Alice did in his work tree first.
t/t5519-push-alternates.sh: # need to send the commit Bob received from Alice
t/t5519-push-alternates.sh: # to his public repository, as all the object Alice
t/t5519-push-alternates.sh: # Check that the second commit by Alice is not sent
t/t5519-push-alternates.sh: # Alice does not care what Bob does. She does not
t/t5519-push-alternates.sh: # This time Bob does not pull from Alice, and
t/t5519-push-alternates.sh: # Alice does not care what Bob does. She does not
t/t5519-push-alternates.sh: # This time Bob does not pull from Alice, and
t/t5519-push-alternates.sh: # necessary tree) in his repository from Alice.
Nicolas
From: Johannes Schindelin <hidden> Date: 2016-06-15 22:46:18
Hi,
On Fri, 27 Feb 2009, George Spelvin wrote:
There's one more change that was suggested that I'd like to propose:
- Make "git grep" search the whole repository by default; include an
explicit "." path limiter to search only the current directory.
I use "git grep" in subdirectories extensively, and I like that it does
_not_ search the whole repository.
Could you suggest a nice way for me to retain that behavior with an
option?
After all, since you propose a change in behavior, it is _your_ duty to
provide ways for those who want the old behavior to get at it easily!
In the alternative, I could suggest "git grep -e <expression> HEAD".
Ciao,
Dscho
On Fri, Feb 27, 2009 at 20:42, Nicolas Pitre [off-list ref] wrote:
[nico@xanadu git]$ git grep Alice
Now try again from within a subdir ;).
I actually prefer the current behavior, and am a very extensive user
of it. Config option? ;)
--
Cheers,
Sverre Rabbelier
I use "git grep" in subdirectories extensively, and I like that it does
_not_ search the whole repository.
Count me too! I find this feature very important.
After all, since you propose a change in behavior, it is _your_ duty to
provide ways for those who want the old behavior to get at it easily!
Agreed.
Pascal.
--
--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://www.obry.net - http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B
From: Markus Heidelberg <hidden> Date: 2016-06-15 22:46:18
George Spelvin, 27.02.2009:
There's one more change that was suggested that I'd like to propose:
- Make "git grep" search the whole repository by default; include an
explicit "." path limiter to search only the current directory.
In addition to being more consistent with other commands like "git log",
this saves a lot of typing working in drivers/net/usb/ if the identifier
you're looking for is in include/.
I use ctags from within the editor Vim therefor. Also grepping may show
too many unwanted results.
Markus