{"thread":{"id":"18049","subject":"Re: [WARNING] Proposed future changes that are backward incompatible","startedAt":"2009-02-27T19:27:08Z","lastAt":"2009-02-28T02:36:34Z","messageCount":9,"participants":["George Spelvin","Nicolas Pitre","Johannes Schindelin","Sverre Rabbelier","Junio C Hamano","Pascal Obry","Markus Heidelberg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"106463","messageId":"20090227192708.6266.qmail@science.horizon.com","threadId":"18049","inReplyTo":null,"subject":"Re: [WARNING] Proposed future changes that are backward incompatible","fromName":"George Spelvin","fromEmail":"linux@horizon.com","sentAt":"2009-02-27T19:27:08Z","receivedAt":"2009-02-27T19:27:08Z","isPatch":false,"sender":{"key":"linux@horizon.com","avatar":null},"body":"There's one more change that was suggested that I'd like to propose:\n- Make \"git grep\" search the whole repository by default; include an\n  explicit \".\" path limiter to search only the current directory.\n\nIn addition to being more consistent with other commands like \"git log\",\nthis saves a lot of typing working in drivers/net/usb/ if the identifier\nyou're looking for is in include/.  Typing the additional space-dot\nis pretty trivial if you want the current directory only.\n"},{"id":"106464","messageId":"alpine.LFD.2.00.0902271439310.5511@xanadu.home","threadId":"18049","inReplyTo":"20090227192708.6266.qmail@science.horizon.com","subject":"Re: [WARNING] Proposed future changes that are backward incompatible","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2009-02-27T19:42:20Z","receivedAt":"2009-02-27T19:42:20Z","isPatch":false,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Fri, 27 Feb 2009, George Spelvin wrote:\n\n> There's one more change that was suggested that I'd like to propose:\n> - Make \"git grep\" search the whole repository by default; include an\n>   explicit \".\" path limiter to search only the current directory.\n\nIsn't that already the default?\n\n[nico@xanadu git]$ git grep Alice\nDocumentation/gittutorial.txt:Suppose that Alice has started a new project with a git repository in\nDocumentation/gittutorial.txt:This creates a new directory \"myrepo\" containing a clone of Alice's\nDocumentation/gittutorial.txt:When he's ready, he tells Alice to pull changes from the repository\nDocumentation/gittutorial.txt:This merges the changes from Bob's \"master\" branch into Alice's\nDocumentation/gittutorial.txt:current branch.  If Alice has made her own changes in the meantime,\nDocumentation/gittutorial.txt:Note that in general, Alice would want her local changes committed before\nDocumentation/gittutorial.txt:initiating this \"pull\".  If Bob's work conflicts with what Alice did since\nDocumentation/gittutorial.txt:their histories forked, Alice will use her working tree and the index to\nDocumentation/gittutorial.txt:refuse to merge --- Alice will have to get rid of her local changes in\nDocumentation/gittutorial.txt:Alice can peek at what Bob did without merging first, using the \"fetch\"\nDocumentation/gittutorial.txt:command; this allows Alice to inspect what Bob did, using a special\nDocumentation/gittutorial.txt:This operation is safe even if Alice has uncommitted local changes.\nDocumentation/gittutorial.txt:Alice already knows everything that leads to her current state (HEAD),\nDocumentation/gittutorial.txt:If Alice wants to visualize what Bob did since their histories forked\nDocumentation/gittutorial.txt:Alice may want to view what both of them did since they forked.\nDocumentation/gittutorial.txt:After inspecting what Bob did, if there is nothing urgent, Alice may\nDocumentation/gittutorial.txt:does have something Alice would immediately need, Alice may choose to\nDocumentation/gittutorial.txt:With this, Alice can perform the first part of the \"pull\" operation alone using the\nDocumentation/gittutorial.txt:Unlike the longhand form, when Alice fetches from Bob using a\nDocumentation/gittutorial.txt:Alice's master branch.\nDocumentation/gittutorial.txt:After examining those changes, Alice\nDocumentation/gittutorial.txt:Later, Bob can update his repo with Alice's latest changes using\nDocumentation/gittutorial.txt:Note that he doesn't need to give the path to Alice's repository;\nDocumentation/gittutorial.txt:when Bob cloned Alice's repository, git stored the location of her\nDocumentation/gittutorial.txt:Git also keeps a pristine copy of Alice's master branch under the\nt/t5519-push-alternates.sh:\t# Project Bob is a fork of project Alice\nt/t5519-push-alternates.sh:\t\t# Bob acquires what Alice did in his work tree first.\nt/t5519-push-alternates.sh:\t\t# need to send the commit Bob received from Alice\nt/t5519-push-alternates.sh:\t\t# to his public repository, as all the object Alice\nt/t5519-push-alternates.sh:\t# Check that the second commit by Alice is not sent\nt/t5519-push-alternates.sh:\t\t# Alice does not care what Bob does.  She does not\nt/t5519-push-alternates.sh:\t\t# This time Bob does not pull from Alice, and\nt/t5519-push-alternates.sh:\t\t# Alice does not care what Bob does.  She does not\nt/t5519-push-alternates.sh:\t\t# This time Bob does not pull from Alice, and\nt/t5519-push-alternates.sh:\t\t# necessary tree) in his repository from Alice.\n\n\nNicolas\n"},{"id":"106467","messageId":"alpine.DEB.1.00.0902272046040.6600@intel-tinevez-2-302","threadId":"18049","inReplyTo":"20090227192708.6266.qmail@science.horizon.com","subject":"Re: [WARNING] Proposed future changes that are backward incompatible","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-02-27T19:48:48Z","receivedAt":"2009-02-27T19:48:48Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 27 Feb 2009, George Spelvin wrote:\n\n> There's one more change that was suggested that I'd like to propose:\n> - Make \"git grep\" search the whole repository by default; include an\n>   explicit \".\" path limiter to search only the current directory.\n\nI use \"git grep\" in subdirectories extensively, and I like that it does \n_not_ search the whole repository.\n\nCould you suggest a nice way for me to retain that behavior with an \noption?\n\nAfter all, since you propose a change in behavior, it is _your_ duty to \nprovide ways for those who want the old behavior to get at it easily!\n\nIn the alternative, I could suggest \"git grep -e <expression> HEAD\".\n\nCiao,\nDscho\n"},{"id":"106468","messageId":"fabb9a1e0902271151qa649d2en6b49e8794f93b889@mail.gmail.com","threadId":"18049","inReplyTo":"alpine.LFD.2.00.0902271439310.5511@xanadu.home","subject":"Re: [WARNING] Proposed future changes that are backward incompatible","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2009-02-27T19:51:22Z","receivedAt":"2009-02-27T19:51:22Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"On Fri, Feb 27, 2009 at 20:42, Nicolas Pitre <nico@cam.org> wrote:\n> [nico@xanadu git]$ git grep Alice\n\nNow try again from within a subdir ;).\n\nI actually prefer the current behavior, and am a very extensive user\nof it. Config option? ;)\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"106469","messageId":"7v3adzk5wb.fsf@gitster.siamese.dyndns.org","threadId":"18049","inReplyTo":"20090227192708.6266.qmail@science.horizon.com","subject":"Re: [WARNING] Proposed future changes that are backward incompatible","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-27T19:59:32Z","receivedAt":"2009-02-27T19:59:32Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"George Spelvin\" <linux@horizon.com> writes:\n\n> There's one more change that was suggested that I'd like to propose:\n> - Make \"git grep\" search the whole repository by default; include an\n>   explicit \".\" path limiter to search only the current directory.\n>\n> In addition to being more consistent with other commands like \"git log\",\n> this saves a lot of typing working in drivers/net/usb/ if the identifier\n> you're looking for is in include/.  Typing the additional space-dot\n> is pretty trivial if you want the current directory only.\n\nI do not remember it was ever suggested, let alone coming to anything near\nconsensus.\n\nThe only way you could justify such a default change is to say:\n\n    Almost all the time, everybody wants to use this new behaviour; the\n    old behaviour is almost never useful in any situation other than a\n    narrow corner case; and if somebody wants to do such a useless thing\n    in a corner case, he can always add \" .\" at the end, so nothing is\n    lost.\n\nI do not think that is true for the change you are proposing here.  'He\ncan always add \" .\" at the end' alone is not a good enough justification.\n\nI however think your use case deserves to be supported, and I would not\nmind at all accepting a new \"--full-tree\" (or some shorter synonym) option\nif the patch is cleanly done (hint, hint).\n\nI'd rather not add this to \"future changes that are backward incompatible\"\nlist.  It may be a useful new feature, but that is not what the topic of\nthis thread is about.\n"},{"id":"106471","messageId":"20090227203108.10186.qmail@science.horizon.com","threadId":"18049","inReplyTo":"7v3adzk5wb.fsf@gitster.siamese.dyndns.org","subject":"Re: [WARNING] Proposed future changes that are backward incompatible","fromName":"George Spelvin","fromEmail":"linux@horizon.com","sentAt":"2009-02-27T20:31:08Z","receivedAt":"2009-02-27T20:31:08Z","isPatch":false,"sender":{"key":"linux@horizon.com","avatar":null},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n\n> \"George Spelvin\" <linux@horizon.com> writes:\n>\n> > There's one more change that was suggested that I'd like to propose:\n> > - Make \"git grep\" search the whole repository by default; include an\n> >   explicit \".\" path limiter to search only the current directory.\n> >\n> > In addition to being more consistent with other commands like \"git log\",\n> > this saves a lot of typing working in drivers/net/usb/ if the identifier\n> > you're looking for is in include/.  Typing the additional space-dot\n> > is pretty trivial if you want the current directory only.\n>\n> I do not remember it was ever suggested, let alone coming to anything near\n> consensus.\n\nThe suggestion was in <83vdsefz9j.fsf@kalahari.s2.org>, available as\nhttp://marc.info/?l=git&m=123216049508531\nbut I agree that there was no consensus.  I just thought this thread was\na good place to elicit discussion, since it would be an incompatible change.\n\n> The only way you could justify such a default change is to say:\n>\n>     Almost all the time, everybody wants to use this new behaviour; the\n>     old behaviour is almost never useful in any situation other than a\n>     narrow corner case; and if somebody wants to do such a useless thing\n>     in a corner case, he can always add \" .\" at the end, so nothing is\n>     lost.\n>\n> I do not think that is true for the change you are proposing here.  'He\n> can always add \" .\" at the end' alone is not a good enough justification.\n\nPlease forgive me, I thought the above *might* be true, and wanted\nto provoke discussion to see how people felt.  The \"consistent with\ngit-log and all that stuff\" argument is quite persuasive to me, but it's\na convenience feature, so it depends on how people feel.\n\n> I however think your use case deserves to be supported, and I would not\n> mind at all accepting a new \"--full-tree\" (or some shorter synonym) option\n> if the patch is cleanly done (hint, hint).\n\nHint taken.  Half of the patch is available at\nhttp://marc.info/?l=git&m=123207990016944\n\nIs -t/--full-tree okay?  I'd rather use -a/--all, but that's taken.  -t\nisn't used by grep(1) either.\n\n\n> I'd rather not add this to \"future changes that are backward incompatible\"\n> list.  It may be a useful new feature, but that is not what the topic of\n> this thread is about.\n\nSorry for veering off on an inappropriate tangent.\n"},{"id":"106483","messageId":"49A85313.70404@obry.net","threadId":"18049","inReplyTo":"alpine.DEB.1.00.0902272046040.6600@intel-tinevez-2-302","subject":"Re: [WARNING] Proposed future changes that are backward incompatible","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2009-02-27T20:54:43Z","receivedAt":"2009-02-27T20:54:43Z","isPatch":false,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"Johannes Schindelin a écrit :\n> I use \"git grep\" in subdirectories extensively, and I like that it does \n> _not_ search the whole repository.\n\nCount me too! I find this feature very important.\n\n> After all, since you propose a change in behavior, it is _your_ duty to \n> provide ways for those who want the old behavior to get at it easily!\n\nAgreed.\n\nPascal.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|    http://www.obry.net  -  http://v2p.fr.eu.org\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B\n"},{"id":"106480","messageId":"7vr61jiof0.fsf@gitster.siamese.dyndns.org","threadId":"18049","inReplyTo":"20090227203108.10186.qmail@science.horizon.com","subject":"Re: [WARNING] Proposed future changes that are backward incompatible","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-27T21:02:27Z","receivedAt":"2009-02-27T21:02:27Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"George Spelvin\" <linux@horizon.com> writes:\n\n> The suggestion was in <83vdsefz9j.fsf@kalahari.s2.org>, available as\n> http://marc.info/?l=git&m=123216049508531\n> but I agree that there was no consensus.  I just thought this thread was\n> a good place to elicit discussion, since it would be an incompatible change.\n>\n>> The only way you could justify such a default change is to say:\n>>\n>>     Almost all the time, everybody wants to use this new behaviour; the\n>>     old behaviour is almost never useful in any situation other than a\n>>     narrow corner case; and if somebody wants to do such a useless thing\n>>     in a corner case, he can always add \" .\" at the end, so nothing is\n>>     lost.\n>>\n>> I do not think that is true for the change you are proposing here.  'He\n>> can always add \" .\" at the end' alone is not a good enough justification.\n>\n> Please forgive me, ...\n\nThere is nothing that needs forgiveness.  Discussion is a good thing, as\nlong as it is not about useless bikeshedding (and I should just learn to\nignore discussions that are useless, instead of getting upset.  Lucikly we\nhaven't had many).\n\n> ... I thought the above *might* be true, and wanted to provoke\n> discussion to see how people felt.\n\nIf you suspected that the above may be true, that the new behaviour should\nbe the default, and that many people may support that view, and wanted to\nconfirm it, then your justification should have really spelled it out.\n\n> The \"consistent with\n> git-log and all that stuff\" argument is quite persuasive to me, but it's\n> a convenience feature, so it depends on how people feel.\n\nConsistency among tools with a similar objective is a good thing to aim\nfor.\n\n\"log\" especially \"log -p\" is about inspecting _changes_ and to understand\nthe change you would more often than not want to view the change in the\nentire context (that is the point of having an atomic while-tree commit).\n\nOn the other hand, \"grep\" is about narrowing down the _state_ you would\nwant to inspect, and unlike the case when you _inspect changes_ where you\nwould more often want to have the entire context, you would more often\nwant to omit unrelated parts of the tree while you are _narrowing down\nstate_ to inspect.  This is especially true when you run it from a\nsubdirectory, and by definition when you are already in a subdirectory,\nyour attention is already narrowed down to the part of the whole tree you\nare currently in.\n\nSo in that sense, I do not see a \"similar objective\" between what log and\ngrep are used for.  They may superficially look similar, but the useful\nmode of operation between them can be different because they are used for\ndifferent purposes.\n"},{"id":"106502","messageId":"200902280336.35390.markus.heidelberg@web.de","threadId":"18049","inReplyTo":"20090227192708.6266.qmail@science.horizon.com","subject":"Re: [WARNING] Proposed future changes that are backward incompatible","fromName":"Markus Heidelberg","fromEmail":"markus.heidelberg@web.de","sentAt":"2009-02-28T02:36:34Z","receivedAt":"2009-02-28T02:36:34Z","isPatch":false,"sender":{"key":"markus.heidelberg@web.de","avatar":"https://avatars.githubusercontent.com/u/6334512?v=4"},"body":"George Spelvin, 27.02.2009:\n> There's one more change that was suggested that I'd like to propose:\n> - Make \"git grep\" search the whole repository by default; include an\n>   explicit \".\" path limiter to search only the current directory.\n> \n> In addition to being more consistent with other commands like \"git log\",\n> this saves a lot of typing working in drivers/net/usb/ if the identifier\n> you're looking for is in include/.\n\nI use ctags from within the editor Vim therefor. Also grepping may show\ntoo many unwanted results.\n\nMarkus\n"}]}