{"thread":{"id":"10709","subject":"Inconsistencies with git log","startedAt":"2007-11-07T22:15:14Z","lastAt":"2007-11-10T22:51:55Z","messageCount":48,"participants":["Jon Smirl","Johannes Schindelin","David Symonds","Brian Gernhardt","Andreas Ericsson","Junio C Hamano","Peter Baumann","Wincent Colaiuta","Daniel Barkalow","Alex Riesen","Linus Torvalds","Jakub Narebski","Michel Marti","Miles Bader"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"58736","messageId":"9e4733910711071415i1729e277u6be19b72cd682a85@mail.gmail.com","threadId":"10709","inReplyTo":null,"subject":"Inconsistencies with git log","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2007-11-07T22:15:14Z","receivedAt":"2007-11-07T22:15:14Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"In project root:\n git log arch/powerpc/platforms/52xx\nworks as expected\n\n cd arch/powerpc/platforms/52xx\n git log arch/powerpc/platforms/52xx\nfatal: ambiguous argument 'arch/powerpc/platforms/52xx': unknown\nrevision or path not in the working tree.\nUse '--' to separate paths from revisions\n\nstill in arch/powerpc/platforms/52xx\ngit log\nget log for the whole project\n\nShouldn't git log give the the log for the tree under the current directory?\n\njonsmirl@terra:~/mpc5200b/arch/powerpc/platforms/52xx$ git --version\ngit version 1.5.3.4.1458.g3e72e\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"58745","messageId":"Pine.LNX.4.64.0711072242230.4362@racer.site","threadId":"10709","inReplyTo":"9e4733910711071415i1729e277u6be19b72cd682a85@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-07T22:42:41Z","receivedAt":"2007-11-07T22:42:41Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 7 Nov 2007, Jon Smirl wrote:\n\n> In project root:\n>  git log arch/powerpc/platforms/52xx\n> works as expected\n> \n>  cd arch/powerpc/platforms/52xx\n>  git log arch/powerpc/platforms/52xx\n> fatal: ambiguous argument 'arch/powerpc/platforms/52xx': unknown\n> revision or path not in the working tree.\n> Use '--' to separate paths from revisions\n\nTry \"git log .\"\n\nHth,\nDscho\n"},{"id":"58746","messageId":"9e4733910711071445p7cfb6cffx83adb1d84d6bf9d8@mail.gmail.com","threadId":"10709","inReplyTo":"Pine.LNX.4.64.0711072242230.4362@racer.site","subject":"Re: Inconsistencies with git log","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2007-11-07T22:45:10Z","receivedAt":"2007-11-07T22:45:10Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"On 11/7/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> Hi,\n>\n> On Wed, 7 Nov 2007, Jon Smirl wrote:\n>\n> > In project root:\n> >  git log arch/powerpc/platforms/52xx\n> > works as expected\n> >\n> >  cd arch/powerpc/platforms/52xx\n> >  git log arch/powerpc/platforms/52xx\n> > fatal: ambiguous argument 'arch/powerpc/platforms/52xx': unknown\n> > revision or path not in the working tree.\n> > Use '--' to separate paths from revisions\n>\n> Try \"git log .\"\n\nShouldn't git log default to \"git log .\"?\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"58750","messageId":"Pine.LNX.4.64.0711072255420.4362@racer.site","threadId":"10709","inReplyTo":"9e4733910711071445p7cfb6cffx83adb1d84d6bf9d8@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-07T22:58:53Z","receivedAt":"2007-11-07T22:58:53Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 7 Nov 2007, Jon Smirl wrote:\n\n> On 11/7/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n>\n> > On Wed, 7 Nov 2007, Jon Smirl wrote:\n> >\n> > > In project root:\n> > >  git log arch/powerpc/platforms/52xx\n> > > works as expected\n> > >\n> > >  cd arch/powerpc/platforms/52xx\n> > >  git log arch/powerpc/platforms/52xx\n> > > fatal: ambiguous argument 'arch/powerpc/platforms/52xx': unknown\n> > > revision or path not in the working tree.\n> > > Use '--' to separate paths from revisions\n> >\n> > Try \"git log .\"\n> \n> Shouldn't git log default to \"git log .\"?\n\nWell, it is in line with the other commands being able to work on \nsubdirectories, but doing the whole repository operation by default.\n\nWe also tend to take the approach of viewing the history as that of \nthe whole project.\n\nThis approach also means that it is a much more expensive operation to log \nthe history as seen by a subdirectory, which is another reason why it is \nnot the default.\n\nHth,\nDscho\n"},{"id":"58751","messageId":"ee77f5c20711071500x71008de5y5ea37aa1df2ba803@mail.gmail.com","threadId":"10709","inReplyTo":"9e4733910711071445p7cfb6cffx83adb1d84d6bf9d8@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"David Symonds","fromEmail":"dsymonds@gmail.com","sentAt":"2007-11-07T23:00:42Z","receivedAt":"2007-11-07T23:00:42Z","isPatch":false,"sender":{"key":"dsymonds@gmail.com","avatar":"https://gravatar.com/avatar/b22f5051cbfc11836e36cf7a690e6cde4e225d835e13295ff98d15c7a9ee3c0f?d=mp&s=160"},"body":"On Nov 8, 2007 9:45 AM, Jon Smirl <jonsmirl@gmail.com> wrote:\n> On 11/7/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> > Hi,\n> >\n> > On Wed, 7 Nov 2007, Jon Smirl wrote:\n> >\n> > > In project root:\n> > >  git log arch/powerpc/platforms/52xx\n> > > works as expected\n> > >\n> > >  cd arch/powerpc/platforms/52xx\n> > >  git log arch/powerpc/platforms/52xx\n> > > fatal: ambiguous argument 'arch/powerpc/platforms/52xx': unknown\n> > > revision or path not in the working tree.\n> > > Use '--' to separate paths from revisions\n> >\n> > Try \"git log .\"\n>\n> Shouldn't git log default to \"git log .\"?\n\nIt might be nice if it did, but since Git tracks whole *trees* (not\nfiles) then it makes more sense to show the log of the repository in\nits default mode.\n\nOn the other hand, it'd sure be nice if git-status would show relative\npaths when you're in subdirectories, especially when you're in a\ndeeply nested directory hierarchy. It's a lot easier to see that\n\"foo.txt\" and \"../bar.txt\" have modifications. Furthermore, it is the\nrelative path that you have to pass to git-add anyway, so quick\ncopy-n-pasting from git-status output often doesn't work.\n\n\nDave.\n"},{"id":"58752","messageId":"9e4733910711071503va92a653s25fd978989d5917d@mail.gmail.com","threadId":"10709","inReplyTo":"Pine.LNX.4.64.0711072255420.4362@racer.site","subject":"Re: Inconsistencies with git log","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2007-11-07T23:03:12Z","receivedAt":"2007-11-07T23:03:12Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"On 11/7/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> > Shouldn't git log default to \"git log .\"?\n>\n> Well, it is in line with the other commands being able to work on\n> subdirectories, but doing the whole repository operation by default.\n\nI agree with this and see how it got this way.\n\n> We also tend to take the approach of viewing the history as that of\n> the whole project.\n\nBut if you type 'git log' while cd'd into a subdirectory the whole log\nis almost never what you want. It's this kind of thing that makes git\nharder to use.\n\n> This approach also means that it is a much more expensive operation to log\n> the history as seen by a subdirectory, which is another reason why it is\n> not the default.\n>\n> Hth,\n> Dscho\n>\n>\n\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"58753","messageId":"Pine.LNX.4.64.0711072309380.4362@racer.site","threadId":"10709","inReplyTo":"9e4733910711071503va92a653s25fd978989d5917d@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-07T23:11:25Z","receivedAt":"2007-11-07T23:11:25Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 7 Nov 2007, Jon Smirl wrote:\n\n> On 11/7/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> \n> > We also tend to take the approach of viewing the history as that of \n> > the whole project.\n> \n> But if you type 'git log' while cd'd into a subdirectory the whole log \n> is almost never what you want. It's this kind of thing that makes git \n> harder to use.\n\nWhen I am working in a subdirectory, I often want the whole history.  For \nexample, when I am working on the documentation, sometimes I need to look \nup a commit real quick, that touched other parts.\n\nBesides, adding a space and a dot is not what qualifies for \"harder to \nuse\" with this developer.\n\nCiao,\nDscho\n"},{"id":"58756","messageId":"9e4733910711071516ic414c28ua272e13db8823fbf@mail.gmail.com","threadId":"10709","inReplyTo":"Pine.LNX.4.64.0711072309380.4362@racer.site","subject":"Re: Inconsistencies with git log","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2007-11-07T23:16:42Z","receivedAt":"2007-11-07T23:16:42Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"On 11/7/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> Besides, adding a space and a dot is not what qualifies for \"harder to\n> use\" with this developer.\n\nIt requires teaching people new to git to add the space dot.\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"58757","messageId":"243E1E6E-4723-42D3-933C-D2A0D1ACE287@silverinsanity.com","threadId":"10709","inReplyTo":"9e4733910711071503va92a653s25fd978989d5917d@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2007-11-07T23:19:24Z","receivedAt":"2007-11-07T23:19:24Z","isPatch":false,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"\nOn Nov 7, 2007, at 6:03 PM, Jon Smirl wrote:\n\n> On 11/7/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n>>\n>> We also tend to take the approach of viewing the history as that of\n>> the whole project.\n>\n> But if you type 'git log' while cd'd into a subdirectory the whole log\n> is almost never what you want. It's this kind of thing that makes git\n> harder to use.\n\nHere's where I'd have to disagree with you.  If I'm in git.git/ \nDocumentation and am trying to remember which commit I'm trying to  \ndocument, suddenly having 90+% of the history vanish would make git  \nharder to use.  Same with my rails projects, my mudlib, etc.  Hiding  \nhistory is a bad default.\n\nI think the problem is that you're still thinking in the CVS-style per- \nfile history.  \"git log\" works on the history not the files, so the  \nautomatic filtering simply doesn't make sense.  Git's whole-tree  \napproach makes it much easier to find when Makefile or API changes  \nhave broken your code.  But if you know that the error is in a  \nspecific place, then using \".\" lets you get at it.\n\nHowever, Dave's suggestion of altering git-status output to be  \nrelative to (but not limited by) CWD has merit.  Too bad I don't have  \ntime to work on it right now.\n\n~~ Brian Gernhardt\n"},{"id":"58760","messageId":"9e4733910711071529m604f3b12v29b3a040074ea4e@mail.gmail.com","threadId":"10709","inReplyTo":"Pine.LNX.4.64.0711072309380.4362@racer.site","subject":"Re: Inconsistencies with git log","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2007-11-07T23:29:38Z","receivedAt":"2007-11-07T23:29:38Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"On 11/7/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> Hi,\n>\n> On Wed, 7 Nov 2007, Jon Smirl wrote:\n>\n> > On 11/7/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> >\n> > > We also tend to take the approach of viewing the history as that of\n> > > the whole project.\n> >\n> > But if you type 'git log' while cd'd into a subdirectory the whole log\n> > is almost never what you want. It's this kind of thing that makes git\n> > harder to use.\n>\n> When I am working in a subdirectory, I often want the whole history.  For\n> example, when I am working on the documentation, sometimes I need to look\n> up a commit real quick, that touched other parts.\n>\n> Besides, adding a space and a dot is not what qualifies for \"harder to\n> use\" with this developer.\n\nSo if git log is always whole tree, why doesn't this work?\n\n cd arch/powerpc/platforms/52xx\n git log arch/powerpc/platforms/52xx\nfatal: ambiguous argument 'arch/powerpc/platforms/52xx': unknown\nrevision or path not in the working tree.\nUse '--' to separate paths from revisions\n\nIt's not consistent. git log with no parameters is relative to the\nproject root, git log with a parameter is relative to the current\ndirectory.\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"58761","messageId":"ee77f5c20711071531q5acc4d06u264f5daad7c04cc4@mail.gmail.com","threadId":"10709","inReplyTo":"243E1E6E-4723-42D3-933C-D2A0D1ACE287@silverinsanity.com","subject":"Re: Inconsistencies with git log","fromName":"David Symonds","fromEmail":"dsymonds@gmail.com","sentAt":"2007-11-07T23:31:22Z","receivedAt":"2007-11-07T23:31:22Z","isPatch":false,"sender":{"key":"dsymonds@gmail.com","avatar":"https://gravatar.com/avatar/b22f5051cbfc11836e36cf7a690e6cde4e225d835e13295ff98d15c7a9ee3c0f?d=mp&s=160"},"body":"On Nov 8, 2007 10:19 AM, Brian Gernhardt <benji@silverinsanity.com> wrote:\n>\n> However, Dave's suggestion of altering git-status output to be\n> relative to (but not limited by) CWD has merit.  Too bad I don't have\n> time to work on it right now.\n\nI am happy to hack on this if there's not widespread revolt against the concept.\n\n\nDave.\n"},{"id":"58764","messageId":"Pine.LNX.4.64.0711080003080.4362@racer.site","threadId":"10709","inReplyTo":"9e4733910711071529m604f3b12v29b3a040074ea4e@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-08T00:04:27Z","receivedAt":"2007-11-08T00:04:27Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 7 Nov 2007, Jon Smirl wrote:\n\n> So if git log is always whole tree, why doesn't this work?\n\ngit log is not always the whole tree.  git log without arguments is.\n\n>  cd arch/powerpc/platforms/52xx\n>  git log arch/powerpc/platforms/52xx\n> fatal: ambiguous argument 'arch/powerpc/platforms/52xx': unknown\n> revision or path not in the working tree.\n> Use '--' to separate paths from revisions\n> \n> It's not consistent. git log with no parameters is relative to the \n> project root, git log with a parameter is relative to the current \n> directory.\n\nIt is consistent, when you realise that the path arguments are interpreted \nrelative to the project root.\n\nHth,\nDscho\n"},{"id":"58765","messageId":"9e4733910711071609t3e5412f1mf02e501b2d820bb3@mail.gmail.com","threadId":"10709","inReplyTo":"Pine.LNX.4.64.0711080003080.4362@racer.site","subject":"Re: Inconsistencies with git log","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2007-11-08T00:09:11Z","receivedAt":"2007-11-08T00:09:11Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"On 11/7/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> It is consistent, when you realise that the path arguments are interpreted\n> relative to the project root.\n\nThen why doesn't this work?\n\njonsmirl@terra:~/mpc5200b$ git log Documentation\nall the log for Documentation....\njonsmirl@terra:~/mpc5200b$ cd Documentation\njonsmirl@terra:~/mpc5200b/Documentation$ git log Documentation\nfatal: ambiguous argument 'Documentation': unknown revision or path\nnot in the working tree.\nUse '--' to separate paths from revisions\njonsmirl@terra:~/mpc5200b/Documentation$\n\n\n\n>\n> Hth,\n> Dscho\n>\n>\n\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"58767","messageId":"Pine.LNX.4.64.0711080009270.4362@racer.site","threadId":"10709","inReplyTo":"ee77f5c20711071531q5acc4d06u264f5daad7c04cc4@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-08T00:09:37Z","receivedAt":"2007-11-08T00:09:37Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 8 Nov 2007, David Symonds wrote:\n\n> On Nov 8, 2007 10:19 AM, Brian Gernhardt <benji@silverinsanity.com> wrote:\n> >\n> > However, Dave's suggestion of altering git-status output to be \n> > relative to (but not limited by) CWD has merit.  Too bad I don't have \n> > time to work on it right now.\n> \n> I am happy to hack on this if there's not widespread revolt against the \n> concept.\n\nToo late ;-)\n\nCiao,\nDscho\n"},{"id":"58768","messageId":"Pine.LNX.4.64.0711080010300.4362@racer.site","threadId":"10709","inReplyTo":"ee77f5c20711071531q5acc4d06u264f5daad7c04cc4@mail.gmail.com","subject":"[PATCH 1/2] Makefile: wt-status.h is also a lib header","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-08T00:10:41Z","receivedAt":"2007-11-08T00:10:41Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nWhen a struct in wt-status.h changes, many files need to be rebuilt.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n Makefile |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex e5dc63b..dad9c5a 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -288,7 +288,8 @@ LIB_H = \\\n \trun-command.h strbuf.h tag.h tree.h git-compat-util.h revision.h \\\n \ttree-walk.h log-tree.h dir.h path-list.h unpack-trees.h builtin.h \\\n \tutf8.h reflog-walk.h patch-ids.h attr.h decorate.h progress.h \\\n-\tmailmap.h remote.h parse-options.h transport.h diffcore.h hash.h\n+\tmailmap.h remote.h parse-options.h transport.h diffcore.h hash.h \\\n+\twt-status.h\n \n DIFF_OBJS = \\\n \tdiff.o diff-lib.o diffcore-break.o diffcore-order.o \\\n-- \n1.5.3.5.1597.g7191\n"},{"id":"58825","messageId":"47325415.1070205@op5.se","threadId":"10709","inReplyTo":"ee77f5c20711071531q5acc4d06u264f5daad7c04cc4@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2007-11-08T00:11:01Z","receivedAt":"2007-11-08T00:11:01Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"David Symonds wrote:\n> On Nov 8, 2007 10:19 AM, Brian Gernhardt <benji@silverinsanity.com> wrote:\n>> However, Dave's suggestion of altering git-status output to be\n>> relative to (but not limited by) CWD has merit.  Too bad I don't have\n>> time to work on it right now.\n> \n> I am happy to hack on this if there's not widespread revolt against the concept.\n> \n\nI'd definitely like that feature, but I wonder how many people will run\n\"git commit -a\" in a subdir after seeing only what they want to see in the\noutput, and then accidentally committing junk somewhere else in the repo.\n\nSo perhaps git-commit -a should also be path-delimited, but where would we\nend up then? It might be better to just let git-status accept a path\ndelimiter and let the path delimiter default to current work-dir.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"58769","messageId":"Pine.LNX.4.64.0711080011170.4362@racer.site","threadId":"10709","inReplyTo":"ee77f5c20711071531q5acc4d06u264f5daad7c04cc4@mail.gmail.com","subject":"[PATCH 2/2] git status: show relative paths when run in a subdirectory","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-08T00:12:22Z","receivedAt":"2007-11-08T00:12:22Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n\tThis looks a bit ugly because quote_crlf() is now also called\n\ton the untracked files, which are not NUL terminated.\n\n\tMaybe someone has an idea how to do this more elegantly.\n\n builtin-runstatus.c |    1 +\n wt-status.c         |   50 ++++++++++++++++++++++++++++++++++++++++++--------\n wt-status.h         |    1 +\n 3 files changed, 44 insertions(+), 8 deletions(-)\n\ndiff --git a/builtin-runstatus.c b/builtin-runstatus.c\nindex 2db25c8..8d167a9 100644\n--- a/builtin-runstatus.c\n+++ b/builtin-runstatus.c\n@@ -14,6 +14,7 @@ int cmd_runstatus(int argc, const char **argv, const char *prefix)\n \n \tgit_config(git_status_config);\n \twt_status_prepare(&s);\n+\ts.prefix = prefix;\n \n \tfor (i = 1; i < argc; i++) {\n \t\tif (!strcmp(argv[i], \"--color\"))\ndiff --git a/wt-status.c b/wt-status.c\nindex 03b5ec4..7386d41 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -82,16 +82,48 @@ static void wt_status_print_trailer(struct wt_status *s)\n \tcolor_fprintf_ln(s->fp, color(WT_STATUS_HEADER), \"#\");\n }\n \n-static const char *quote_crlf(const char *in, char *buf, size_t sz)\n+static const char *quote_crlf(const char *in, int len, char *buf, size_t sz,\n+\tconst char *prefix)\n {\n \tconst char *scan;\n \tchar *out;\n \tconst char *ret = in;\n+\tint off = 0;\n+\n+\tif (len < 0)\n+\t\tlen = strlen(in);\n+\n+\tif (prefix) {\n+\t\twhile (prefix[off] && off < len && prefix[off] == in[off])\n+\t\t\tif (prefix[off] == '/') {\n+\t\t\t\tprefix += off + 1;\n+\t\t\t\tin += off + 1;\n+\t\t\t\tlen -= off + 1;\n+\t\t\t\toff = 0;\n+\t\t\t} else\n+\t\t\t\toff++;\n+\t\tfor (off = 0; *prefix; prefix++)\n+\t\t\tif (*prefix == '/') {\n+\t\t\t\tif (off + 4 >= sz) {\n+\t\t\t\t\twarning (\"Could not prefix path: %s\",\n+\t\t\t\t\t\tin);\n+\t\t\t\t\treturn in;\n+\t\t\t\t}\n+\t\t\t\tstrcpy(buf + off, \"../\");\n+\t\t\t\toff += 3;\n+\t\t\t}\n+\t\tret = buf;\n+\t}\n \n-\tfor (scan = in, out = buf; *scan; scan++) {\n+\tfor (scan = in, out = buf + off; len; scan++, len--) {\n \t\tint ch = *scan;\n \t\tint quoted;\n \n+\t\tif (out - buf + 3 >= sz) {\n+\t\t\twarning (\"Could not quote path: %s\", in);\n+\t\t\tbreak;\n+\t\t}\n+\n \t\tswitch (ch) {\n \t\tcase '\\n':\n \t\t\tquoted = 'n';\n@@ -118,8 +150,8 @@ static void wt_status_print_filepair(struct wt_status *s,\n \tconst char *one, *two;\n \tchar onebuf[PATH_MAX], twobuf[PATH_MAX];\n \n-\tone = quote_crlf(p->one->path, onebuf, sizeof(onebuf));\n-\ttwo = quote_crlf(p->two->path, twobuf, sizeof(twobuf));\n+\tone = quote_crlf(p->one->path, -1, onebuf, sizeof(onebuf), s->prefix);\n+\ttwo = quote_crlf(p->two->path, -1, twobuf, sizeof(twobuf), s->prefix);\n \n \tcolor_fprintf(s->fp, color(WT_STATUS_HEADER), \"#\\t\");\n \tswitch (p->status) {\n@@ -215,8 +247,8 @@ static void wt_status_print_initial(struct wt_status *s)\n \tfor (i = 0; i < active_nr; i++) {\n \t\tcolor_fprintf(s->fp, color(WT_STATUS_HEADER), \"#\\t\");\n \t\tcolor_fprintf_ln(s->fp, color(WT_STATUS_UPDATED), \"new file: %s\",\n-\t\t\t\tquote_crlf(active_cache[i]->name,\n-\t\t\t\t\t   buf, sizeof(buf)));\n+\t\t\t\tquote_crlf(active_cache[i]->name, -1,\n+\t\t\t\t\t   buf, sizeof(buf), s->prefix));\n \t}\n \tif (active_nr)\n \t\twt_status_print_trailer(s);\n@@ -254,6 +286,7 @@ static void wt_status_print_untracked(struct wt_status *s)\n \tconst char *x;\n \tint i;\n \tint shown_header = 0;\n+\tchar buf[PATH_MAX];\n \n \tmemset(&dir, 0, sizeof(dir));\n \n@@ -291,8 +324,9 @@ static void wt_status_print_untracked(struct wt_status *s)\n \t\t\tshown_header = 1;\n \t\t}\n \t\tcolor_fprintf(s->fp, color(WT_STATUS_HEADER), \"#\\t\");\n-\t\tcolor_fprintf_ln(s->fp, color(WT_STATUS_UNTRACKED), \"%.*s\",\n-\t\t\t\tent->len, ent->name);\n+\t\tcolor_fprintf_ln(s->fp, color(WT_STATUS_UNTRACKED), \"%s\",\n+\t\t\t\tquote_crlf(ent->name, ent->len,\n+\t\t\t\t\tbuf, sizeof(buf), s->prefix));\n \t}\n }\n \ndiff --git a/wt-status.h b/wt-status.h\nindex 7744932..f58ebcb 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -23,6 +23,7 @@ struct wt_status {\n \tint workdir_untracked;\n \tconst char *index_file;\n \tFILE *fp;\n+\tconst char *prefix;\n };\n \n int git_status_config(const char *var, const char *value);\n-- \n1.5.3.5.1597.g7191\n"},{"id":"58770","messageId":"ee77f5c20711071614g7f0b9f84oc419590a586e16b7@mail.gmail.com","threadId":"10709","inReplyTo":"Pine.LNX.4.64.0711080009270.4362@racer.site","subject":"Re: Inconsistencies with git log","fromName":"David Symonds","fromEmail":"dsymonds@gmail.com","sentAt":"2007-11-08T00:14:17Z","receivedAt":"2007-11-08T00:14:17Z","isPatch":false,"sender":{"key":"dsymonds@gmail.com","avatar":"https://gravatar.com/avatar/b22f5051cbfc11836e36cf7a690e6cde4e225d835e13295ff98d15c7a9ee3c0f?d=mp&s=160"},"body":"On Nov 8, 2007 11:09 AM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> Hi,\n>\n>\n> On Thu, 8 Nov 2007, David Symonds wrote:\n>\n> > On Nov 8, 2007 10:19 AM, Brian Gernhardt <benji@silverinsanity.com> wrote:\n> > >\n> > > However, Dave's suggestion of altering git-status output to be\n> > > relative to (but not limited by) CWD has merit.  Too bad I don't have\n> > > time to work on it right now.\n> >\n> > I am happy to hack on this if there's not widespread revolt against the\n> > concept.\n>\n> Too late ;-)\n\nI see that you're revolting against relative paths in git-log; I agree\nwith you on that. I'm proposing changing the output to git-status so\nthat it produces relative paths, which are suitable for\ngit-add/git-rm/git-diff/...\n\n\nDave.\n"},{"id":"58826","messageId":"4732556F.30105@op5.se","threadId":"10709","inReplyTo":"9e4733910711071609t3e5412f1mf02e501b2d820bb3@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2007-11-08T00:16:47Z","receivedAt":"2007-11-08T00:16:47Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Jon Smirl wrote:\n> On 11/7/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n>> It is consistent, when you realise that the path arguments are interpreted\n>> relative to the project root.\n> \n> Then why doesn't this work?\n> \n> jonsmirl@terra:~/mpc5200b$ git log Documentation\n> all the log for Documentation....\n> jonsmirl@terra:~/mpc5200b$ cd Documentation\n> jonsmirl@terra:~/mpc5200b/Documentation$ git log Documentation\n> fatal: ambiguous argument 'Documentation': unknown revision or path\n> not in the working tree.\n> Use '--' to separate paths from revisions\n> jonsmirl@terra:~/mpc5200b/Documentation$\n> \n\nBecause your current working directory, relative to the project root, is\nprepended to the path you're in, so git sees \"Documentation/Documentation\".\nI'm unsure why\n\n\tcd Documentation; git log -- /Documentation\n\ndoesn't do the trick though. I know that particular trick used to work for\nsome other command a while back anyways.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"58775","messageId":"Pine.LNX.4.64.0711080034420.4362@racer.site","threadId":"10709","inReplyTo":"9e4733910711071609t3e5412f1mf02e501b2d820bb3@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-08T00:35:50Z","receivedAt":"2007-11-08T00:35:50Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 7 Nov 2007, Jon Smirl wrote:\n\n> On 11/7/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> > It is consistent, when you realise that the path arguments are interpreted\n> > relative to the project root.\n> \n> Then why doesn't this work?\n> \n> jonsmirl@terra:~/mpc5200b$ git log Documentation\n> all the log for Documentation....\n> jonsmirl@terra:~/mpc5200b$ cd Documentation\n> jonsmirl@terra:~/mpc5200b/Documentation$ git log Documentation\n> fatal: ambiguous argument 'Documentation': unknown revision or path\n> not in the working tree.\n> Use '--' to separate paths from revisions\n\nBecause you are in the subdirectory Documentation/, relative to the \nproject root.  So when you say \"Documentation\", it tries to find the \nfile/directory Documentation/Documentation.\n\nTherefore, just say \"git log .\" and you will get what you want.\n\nCiao,\nDscho\n"},{"id":"58779","messageId":"3F3DD397-AD37-4D51-8531-A76E320C188D@silverinsanity.com","threadId":"10709","inReplyTo":"ee77f5c20711071614g7f0b9f84oc419590a586e16b7@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2007-11-08T00:52:12Z","receivedAt":"2007-11-08T00:52:12Z","isPatch":false,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"\nOn Nov 7, 2007, at 7:14 PM, David Symonds wrote:\n\n> On Nov 8, 2007 11:09 AM, Johannes Schindelin <Johannes.Schindelin@gmx.de \n> > wrote:\n>> Too late ;-)\n>\n> I see that you're revolting against relative paths in git-log; I agree\n> with you on that. I'm proposing changing the output to git-status so\n> that it produces relative paths\n\nJohannes was referring to the fact that he already produced that  \npatches for it.  :-)\n\n~~ Brian\n"},{"id":"58781","messageId":"ee77f5c20711071653x6a1fe8f8peb8ac2714941d2bb@mail.gmail.com","threadId":"10709","inReplyTo":"Pine.LNX.4.64.0711080011170.4362@racer.site","subject":"Re: [PATCH 2/2] git status: show relative paths when run in a subdirectory","fromName":"David Symonds","fromEmail":"dsymonds@gmail.com","sentAt":"2007-11-08T00:53:48Z","receivedAt":"2007-11-08T00:53:48Z","isPatch":true,"sender":{"key":"dsymonds@gmail.com","avatar":"https://gravatar.com/avatar/b22f5051cbfc11836e36cf7a690e6cde4e225d835e13295ff98d15c7a9ee3c0f?d=mp&s=160"},"body":"On Nov 8, 2007 11:12 AM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>\n>         This looks a bit ugly because quote_crlf() is now also called\n>         on the untracked files, which are not NUL terminated.\n>\n>         Maybe someone has an idea how to do this more elegantly.\n>\n>  builtin-runstatus.c |    1 +\n>  wt-status.c         |   50 ++++++++++++++++++++++++++++++++++++++++++--------\n>  wt-status.h         |    1 +\n>  3 files changed, 44 insertions(+), 8 deletions(-)\n\nTested, and looks good.\n\nNow that I play with it, though, it seems that a few other bits of git\nneed updating to handle relative paths okay:\n\n$ cd gitweb/test\n$ rm ../../wt-status.h\n    [oops, what a silly thing to do -- better checkout the latest\nrevision of it]\n$ git status\n# On branch next\n# Changed but not updated:\n#   (use \"git add/rm <file>...\" to update what will be committed)\n#\n#       deleted:    ../../wt-status.h\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\n$ git checkout HEAD ../../wt-status.h\nfatal: git-ls-files: cannot generate relative filenames containing '..'\n    [grr....]\n$ cd ../..\n$ git checkout HEAD .\n    [that works]\n\n\n\nDave.\n"},{"id":"58784","messageId":"Pine.LNX.4.64.0711080059400.4362@racer.site","threadId":"10709","inReplyTo":"ee77f5c20711071653x6a1fe8f8peb8ac2714941d2bb@mail.gmail.com","subject":"Re: [PATCH 2/2] git status: show relative paths when run in a subdirectory","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-08T01:00:16Z","receivedAt":"2007-11-08T01:00:16Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 8 Nov 2007, David Symonds wrote:\n\n> On Nov 8, 2007 11:12 AM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> >\n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > ---\n> >\n> >         This looks a bit ugly because quote_crlf() is now also called\n> >         on the untracked files, which are not NUL terminated.\n> >\n> >         Maybe someone has an idea how to do this more elegantly.\n> >\n> >  builtin-runstatus.c |    1 +\n> >  wt-status.c         |   50 ++++++++++++++++++++++++++++++++++++++++++--------\n> >  wt-status.h         |    1 +\n> >  3 files changed, 44 insertions(+), 8 deletions(-)\n> \n> Tested, and looks good.\n> \n> Now that I play with it, though, it seems that a few other bits of git\n> need updating to handle relative paths okay:\n> \n> $ cd gitweb/test\n> $ rm ../../wt-status.h\n>     [oops, what a silly thing to do -- better checkout the latest\n> revision of it]\n> $ git status\n> # On branch next\n> # Changed but not updated:\n> #   (use \"git add/rm <file>...\" to update what will be committed)\n> #\n> #       deleted:    ../../wt-status.h\n> no changes added to commit (use \"git add\" and/or \"git commit -a\")\n> $ git checkout HEAD ../../wt-status.h\n> fatal: git-ls-files: cannot generate relative filenames containing '..'\n>     [grr....]\n> $ cd ../..\n> $ git checkout HEAD .\n>     [that works]\n\nWell, now that I did all the hard work with git-status, I leave this easy \nexercise for you ;-)\n\nCiao,\nDscho\n"},{"id":"58827","messageId":"7v8x593zyv.fsf@gitster.siamese.dyndns.org","threadId":"10709","inReplyTo":"Pine.LNX.4.64.0711080011170.4362@racer.site","subject":"Re: [PATCH 2/2] git status: show relative paths when run in a subdirectory","fromName":"Junio C Hamano","fromEmail":"junio@pobox.com","sentAt":"2007-11-08T08:26:16Z","receivedAt":"2007-11-08T08:26:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> -static const char *quote_crlf(const char *in, char *buf, size_t sz)\n> +static const char *quote_crlf(const char *in, int len, char *buf, size_t sz,\n> +\tconst char *prefix)\n>  {\n\nThis is not quote_*crlf* anymore.\n\n> @@ -118,8 +150,8 @@ static void wt_status_print_filepair(struct wt_status *s,\n>  \tconst char *one, *two;\n>  \tchar onebuf[PATH_MAX], twobuf[PATH_MAX];\n>  \n> -\tone = quote_crlf(p->one->path, onebuf, sizeof(onebuf));\n> -\ttwo = quote_crlf(p->two->path, twobuf, sizeof(twobuf));\n> +\tone = quote_crlf(p->one->path, -1, onebuf, sizeof(onebuf), s->prefix);\n> +\ttwo = quote_crlf(p->two->path, -1, twobuf, sizeof(twobuf), s->prefix);\n\nI wonder if it makes more sense to use strbuf here...\n"},{"id":"58828","messageId":"20071108082914.GA28800@xp.machine.xx","threadId":"10709","inReplyTo":"47325415.1070205@op5.se","subject":"Re: Inconsistencies with git log","fromName":"Peter Baumann","fromEmail":"waste.manager@gmx.de","sentAt":"2007-11-08T08:29:14Z","receivedAt":"2007-11-08T08:29:14Z","isPatch":false,"sender":{"key":"waste.manager@gmx.de","avatar":null},"body":"On Thu, Nov 08, 2007 at 01:11:01AM +0100, Andreas Ericsson wrote:\n> David Symonds wrote:\n>> On Nov 8, 2007 10:19 AM, Brian Gernhardt <benji@silverinsanity.com> wrote:\n>>> However, Dave's suggestion of altering git-status output to be\n>>> relative to (but not limited by) CWD has merit.  Too bad I don't have\n>>> time to work on it right now.\n>>\n>> I am happy to hack on this if there's not widespread revolt against the concept.\n>>\n>\n> I'd definitely like that feature, but I wonder how many people will run\n> \"git commit -a\" in a subdir after seeing only what they want to see in the\n> output, and then accidentally committing junk somewhere else in the repo.\n>\n> So perhaps git-commit -a should also be path-delimited, but where would we\n> end up then? It might be better to just let git-status accept a path\n> delimiter and let the path delimiter default to current work-dir.\n>\n\nI agree that 'git status' should show the *whole* tree and if it will work\nin subdirectories with 'git status .' or 'git status Documentation', it\nwould be a nice UI improvement.\n\nBut please don't make it always show only the current subdir.\n\n-Peter\n"},{"id":"58838","messageId":"ABA55D82-3CB3-4AAA-9C0A-7A7B0C4F91AE@wincent.com","threadId":"10709","inReplyTo":"9e4733910711071503va92a653s25fd978989d5917d@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"Wincent Colaiuta","fromEmail":"win@wincent.com","sentAt":"2007-11-08T09:19:21Z","receivedAt":"2007-11-08T09:19:21Z","isPatch":false,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"El 8/11/2007, a las 0:03, Jon Smirl escribió:\n\n> On 11/7/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n>>\n>>\n>> We also tend to take the approach of viewing the history as that of\n>> the whole project.\n>\n> But if you type 'git log' while cd'd into a subdirectory the whole log\n> is almost never what you want. It's this kind of thing that makes git\n> harder to use.\n\nAt least in my case, that's completely untrue. Whole-project history  \nis basically *always* what I want even if I am cd'd into a  \nsubdirectory. If I wanted to path-limit the project history I'd do  \n\"git log .\"\n\nCheers,\nWincent\n"},{"id":"58839","messageId":"6E9C860B-E2DC-4F4A-9B80-72189F5479DC@wincent.com","threadId":"10709","inReplyTo":"9e4733910711071529m604f3b12v29b3a040074ea4e@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"Wincent Colaiuta","fromEmail":"win@wincent.com","sentAt":"2007-11-08T09:24:05Z","receivedAt":"2007-11-08T09:24:05Z","isPatch":false,"sender":{"key":"greg@hurrell.net","avatar":"https://avatars.githubusercontent.com/u/7074?v=4"},"body":"El 8/11/2007, a las 0:29, Jon Smirl escribió:\n\n> It's not consistent. git log with no parameters is relative to the\n> project root, git log with a parameter is relative to the current\n> directory.\n\nA minor quibble: git log with no parameters isn't \"relative\" to  \nanything. It shows the history of the entire project. There is no  \ninconsistency.\n\nCheers,\nWincent\n"},{"id":"58881","messageId":"ee77f5c20711080516n4f207ba3pccc8efffa2a6ad4c@mail.gmail.com","threadId":"10709","inReplyTo":"47325415.1070205@op5.se","subject":"Re: Inconsistencies with git log","fromName":"David Symonds","fromEmail":"dsymonds@gmail.com","sentAt":"2007-11-08T13:16:59Z","receivedAt":"2007-11-08T13:16:59Z","isPatch":false,"sender":{"key":"dsymonds@gmail.com","avatar":"https://gravatar.com/avatar/b22f5051cbfc11836e36cf7a690e6cde4e225d835e13295ff98d15c7a9ee3c0f?d=mp&s=160"},"body":"On Nov 8, 2007 11:11 AM, Andreas Ericsson <ae@op5.se> wrote:\n>\n> David Symonds wrote:\n> > On Nov 8, 2007 10:19 AM, Brian Gernhardt <benji@silverinsanity.com> wrote:\n> >> However, Dave's suggestion of altering git-status output to be\n> >> relative to (but not limited by) CWD has merit.  Too bad I don't have\n> >> time to work on it right now.\n> >\n> > I am happy to hack on this if there's not widespread revolt against the concept.\n> >\n>\n> I'd definitely like that feature, but I wonder how many people will run\n> \"git commit -a\" in a subdir after seeing only what they want to see in the\n> output, and then accidentally committing junk somewhere else in the repo.\n\nI never suggested path *limited*, only path *relative*. git-status\nwould still show all the same files, but their paths would be relative\nto your current directory, so there'd be no confusion like you\nmentioned. This is how Johannes' patch works.\n\n\nDave.\n"},{"id":"58884","messageId":"473311DE.3070201@op5.se","threadId":"10709","inReplyTo":"ee77f5c20711080516n4f207ba3pccc8efffa2a6ad4c@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2007-11-08T13:40:46Z","receivedAt":"2007-11-08T13:40:46Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"David Symonds wrote:\n> On Nov 8, 2007 11:11 AM, Andreas Ericsson <ae@op5.se> wrote:\n>> David Symonds wrote:\n>>> On Nov 8, 2007 10:19 AM, Brian Gernhardt <benji@silverinsanity.com> wrote:\n>>>> However, Dave's suggestion of altering git-status output to be\n>>>> relative to (but not limited by) CWD has merit.  Too bad I don't have\n>>>> time to work on it right now.\n>>> I am happy to hack on this if there's not widespread revolt against the concept.\n>>>\n>> I'd definitely like that feature, but I wonder how many people will run\n>> \"git commit -a\" in a subdir after seeing only what they want to see in the\n>> output, and then accidentally committing junk somewhere else in the repo.\n> \n> I never suggested path *limited*, only path *relative*. git-status\n> would still show all the same files, but their paths would be relative\n> to your current directory, so there'd be no confusion like you\n> mentioned. This is how Johannes' patch works.\n> \n\nAh, that'd be a different matter entirely then. Thanks for clarifying. I\nhave no further objections then.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"58923","messageId":"Pine.LNX.4.64.0711081305010.29952@iabervon.org","threadId":"10709","inReplyTo":"9e4733910711071529m604f3b12v29b3a040074ea4e@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2007-11-08T18:28:58Z","receivedAt":"2007-11-08T18:28:58Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Wed, 7 Nov 2007, Jon Smirl wrote:\n\n> On 11/7/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> > Hi,\n> >\n> > On Wed, 7 Nov 2007, Jon Smirl wrote:\n> >\n> > > On 11/7/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> > >\n> > > > We also tend to take the approach of viewing the history as that of\n> > > > the whole project.\n> > >\n> > > But if you type 'git log' while cd'd into a subdirectory the whole log\n> > > is almost never what you want. It's this kind of thing that makes git\n> > > harder to use.\n> >\n> > When I am working in a subdirectory, I often want the whole history.  For\n> > example, when I am working on the documentation, sometimes I need to look\n> > up a commit real quick, that touched other parts.\n> >\n> > Besides, adding a space and a dot is not what qualifies for \"harder to\n> > use\" with this developer.\n> \n> So if git log is always whole tree, why doesn't this work?\n> \n>  cd arch/powerpc/platforms/52xx\n>  git log arch/powerpc/platforms/52xx\n> fatal: ambiguous argument 'arch/powerpc/platforms/52xx': unknown\n> revision or path not in the working tree.\n> Use '--' to separate paths from revisions\n> \n> It's not consistent. git log with no parameters is relative to the\n> project root, git log with a parameter is relative to the current\n> directory.\n\ngit log with no parameters is still relative to the current directory. \nIt's just not limited by paths at all, so what it's relative to doesn't \nmatter.\n\nSince it shows is commits that change any of the given paths, the \nperfectly consistant thing to do without any paths would be to show no \ncommits. Of course, that's totally useless, so we default to making no \nlimitation instead.\n\nIf there were any other options that took paths or filenames, they'd be \nrelative to the subdirectory, regardless of whether there were any paths, \nand having no paths would still show history for the project without \nregard to whether commits touch paths.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"},{"id":"58937","messageId":"20071108212123.GA4899@steel.home","threadId":"10709","inReplyTo":"ee77f5c20711080516n4f207ba3pccc8efffa2a6ad4c@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-11-08T21:21:23Z","receivedAt":"2007-11-08T21:21:23Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"David Symonds, Thu, Nov 08, 2007 14:16:59 +0100:\n> I never suggested path *limited*, only path *relative*. git-status\n> would still show all the same files, but their paths would be relative\n> to your current directory, so there'd be no confusion like you\n> mentioned. This is how Johannes' patch works.\n\nRelative? Like this?\n\n$ cd project/foo/bar\n$ git status\n...\n    M file1.c\n    M file2.c\n    M ../baz/file3.c\n    R ../bax/file4 => file4.c\n"},{"id":"58938","messageId":"20071108212320.GB4899@steel.home","threadId":"10709","inReplyTo":"20071108212123.GA4899@steel.home","subject":"Re: Inconsistencies with git log","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-11-08T21:23:20Z","receivedAt":"2007-11-08T21:23:20Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Alex Riesen, Thu, Nov 08, 2007 22:21:23 +0100:\n> David Symonds, Thu, Nov 08, 2007 14:16:59 +0100:\n> > I never suggested path *limited*, only path *relative*. git-status\n> > would still show all the same files, but their paths would be relative\n> > to your current directory, so there'd be no confusion like you\n> > mentioned. This is how Johannes' patch works.\n> \n> Relative? Like this?\n> \n> $ cd project/foo/bar\n> $ git status\n> ...\n>     M file1.c\n>     M file2.c\n>     M ../baz/file3.c\n>     R ../bax/file4 => file4.c\n> \n\nOh, I see. Yes. Cool.\n"},{"id":"59064","messageId":"Pine.LNX.4.64.0711091529570.4362@racer.site","threadId":"10709","inReplyTo":"7v8x593zyv.fsf@gitster.siamese.dyndns.org","subject":"[PATCH REPLACEMENT for 2/2] git status: show relative paths when run in a subdirectory","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-09T15:30:52Z","receivedAt":"2007-11-09T15:30:52Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nTo show the relative paths, the function formerly called quote_crlf()\n(now called quote_path()) takes the prefix as an additional argument.\n\nWhile at it, the static buffers were replaced by strbufs.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n\tOn Thu, 8 Nov 2007, Junio C Hamano wrote:\n\n\t> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\t> \n\t> > -static const char *quote_crlf(const char *in, char *buf, size_t sz)\n\t> > +static const char *quote_crlf(const char *in, int len, char *buf, size_t sz,\n\t> > +\tconst char *prefix)\n\t> >  {\n\t> \n\t> This is not quote_*crlf* anymore.\n\t> \n\t> > @@ -118,8 +150,8 @@ static void wt_status_print_filepair(struct wt_status *s,\n\t> >  \tconst char *one, *two;\n\t> >  \tchar onebuf[PATH_MAX], twobuf[PATH_MAX];\n\t> >  \n\t> > -\tone = quote_crlf(p->one->path, onebuf, sizeof(onebuf));\n\t> > -\ttwo = quote_crlf(p->two->path, twobuf, sizeof(twobuf));\n\t> > +\tone = quote_crlf(p->one->path, -1, onebuf, sizeof(onebuf), s->prefix);\n\t> > +\ttwo = quote_crlf(p->two->path, -1, twobuf, sizeof(twobuf), s->prefix);\n\t> \n\t> I wonder if it makes more sense to use strbuf here...\n\n\tHere you are.\n\n builtin-runstatus.c |    1 +\n t/t7502-status.sh   |   91 +++++++++++++++++++++++++++++++++++++++++++++++++++\n wt-status.c         |   69 ++++++++++++++++++++++++++-------------\n wt-status.h         |    1 +\n 4 files changed, 139 insertions(+), 23 deletions(-)\n create mode 100755 t/t7502-status.sh\n\ndiff --git a/builtin-runstatus.c b/builtin-runstatus.c\nindex 2db25c8..8d167a9 100644\n--- a/builtin-runstatus.c\n+++ b/builtin-runstatus.c\n@@ -14,6 +14,7 @@ int cmd_runstatus(int argc, const char **argv, const char *prefix)\n \n \tgit_config(git_status_config);\n \twt_status_prepare(&s);\n+\ts.prefix = prefix;\n \n \tfor (i = 1; i < argc; i++) {\n \t\tif (!strcmp(argv[i], \"--color\"))\ndiff --git a/t/t7502-status.sh b/t/t7502-status.sh\nnew file mode 100755\nindex 0000000..269b334\n--- /dev/null\n+++ b/t/t7502-status.sh\n@@ -0,0 +1,91 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2007 Johannes E. Schindelin\n+#\n+\n+test_description='git-status'\n+\n+. ./test-lib.sh\n+\n+test_expect_success 'setup' '\n+\t: > tracked &&\n+\t: > modified &&\n+\tmkdir dir1 &&\n+\t: > dir1/tracked &&\n+\t: > dir1/modified &&\n+\tmkdir dir2 &&\n+\t: > dir1/tracked &&\n+\t: > dir1/modified &&\n+\tgit add . &&\n+\ttest_tick &&\n+\tgit commit -m initial &&\n+\t: > untracked &&\n+\t: > dir1/untracked &&\n+\t: > dir2/untracked &&\n+\techo 1 > dir1/modified &&\n+\techo 2 > dir2/modified &&\n+\techo 3 > dir2/added &&\n+\tgit add dir2/added\n+'\n+\n+cat > expect << \\EOF\n+# On branch master\n+# Changes to be committed:\n+#   (use \"git reset HEAD <file>...\" to unstage)\n+#\n+#\tnew file:   dir2/added\n+#\n+# Changed but not updated:\n+#   (use \"git add <file>...\" to update what will be committed)\n+#\n+#\tmodified:   dir1/modified\n+#\n+# Untracked files:\n+#   (use \"git add <file>...\" to include in what will be committed)\n+#\n+#\tdir1/untracked\n+#\tdir2/modified\n+#\tdir2/untracked\n+#\texpect\n+#\toutput\n+#\tuntracked\n+EOF\n+\n+test_expect_success 'status' '\n+\n+\tgit status > output &&\n+\tgit diff expect output\n+\n+'\n+\n+cat > expect << \\EOF\n+# On branch master\n+# Changes to be committed:\n+#   (use \"git reset HEAD <file>...\" to unstage)\n+#\n+#\tnew file:   ../dir2/added\n+#\n+# Changed but not updated:\n+#   (use \"git add <file>...\" to update what will be committed)\n+#\n+#\tmodified:   ../dir1/modified\n+#\n+# Untracked files:\n+#   (use \"git add <file>...\" to include in what will be committed)\n+#\n+#\tuntracked\n+#\t../dir2/modified\n+#\t../dir2/untracked\n+#\t../expect\n+#\t../output\n+#\t../untracked\n+EOF\n+\n+test_expect_success 'status with relative paths' '\n+\n+\t(cd dir1 && git status) > output &&\n+\tgit diff expect output\n+\n+'\n+\n+test_done\ndiff --git a/wt-status.c b/wt-status.c\nindex 03b5ec4..0d25362 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -82,33 +82,46 @@ static void wt_status_print_trailer(struct wt_status *s)\n \tcolor_fprintf_ln(s->fp, color(WT_STATUS_HEADER), \"#\");\n }\n \n-static const char *quote_crlf(const char *in, char *buf, size_t sz)\n+static char *quote_path(const char *in, int len,\n+\t\tstruct strbuf *out, const char *prefix)\n {\n-\tconst char *scan;\n-\tchar *out;\n-\tconst char *ret = in;\n+\tif (len > 0)\n+\t\tstrbuf_grow(out, len);\n+\tstrbuf_setlen(out, 0);\n+\n+\tif (prefix) {\n+\t\tint off = 0;\n+\t\twhile (prefix[off] && off < len && prefix[off] == in[off])\n+\t\t\tif (prefix[off] == '/') {\n+\t\t\t\tprefix += off + 1;\n+\t\t\t\tin += off + 1;\n+\t\t\t\tlen -= off + 1;\n+\t\t\t\toff = 0;\n+\t\t\t} else\n+\t\t\t\toff++;\n+\n+\t\tfor (; *prefix; prefix++)\n+\t\t\tif (*prefix == '/')\n+\t\t\t\tstrbuf_addstr(out, \"../\");\n+\t}\n \n-\tfor (scan = in, out = buf; *scan; scan++) {\n-\t\tint ch = *scan;\n-\t\tint quoted;\n+\tfor (; (len < 0 && *in) || len > 0; in++, len--) {\n+\t\tint ch = *in;\n \n \t\tswitch (ch) {\n \t\tcase '\\n':\n-\t\t\tquoted = 'n';\n+\t\t\tstrbuf_addstr(out, \"\\\\n\");\n \t\t\tbreak;\n \t\tcase '\\r':\n-\t\t\tquoted = 'r';\n+\t\t\tstrbuf_addstr(out, \"\\\\r\");\n \t\t\tbreak;\n \t\tdefault:\n-\t\t\t*out++ = ch;\n+\t\t\tstrbuf_addch(out, ch);\n \t\t\tcontinue;\n \t\t}\n-\t\t*out++ = '\\\\';\n-\t\t*out++ = quoted;\n-\t\tret = buf;\n \t}\n-\t*out = '\\0';\n-\treturn ret;\n+\n+\treturn out->buf;\n }\n \n static void wt_status_print_filepair(struct wt_status *s,\n@@ -116,10 +129,12 @@ static void wt_status_print_filepair(struct wt_status *s,\n {\n \tconst char *c = color(t);\n \tconst char *one, *two;\n-\tchar onebuf[PATH_MAX], twobuf[PATH_MAX];\n+\tstruct strbuf onebuf, twobuf;\n \n-\tone = quote_crlf(p->one->path, onebuf, sizeof(onebuf));\n-\ttwo = quote_crlf(p->two->path, twobuf, sizeof(twobuf));\n+\tstrbuf_init(&onebuf, 0);\n+\tstrbuf_init(&twobuf, 0);\n+\tone = quote_path(p->one->path, -1, &onebuf, s->prefix);\n+\ttwo = quote_path(p->two->path, -1, &twobuf, s->prefix);\n \n \tcolor_fprintf(s->fp, color(WT_STATUS_HEADER), \"#\\t\");\n \tswitch (p->status) {\n@@ -151,6 +166,8 @@ static void wt_status_print_filepair(struct wt_status *s,\n \t\tdie(\"bug: unhandled diff status %c\", p->status);\n \t}\n \tfprintf(s->fp, \"\\n\");\n+\tstrbuf_release(&onebuf);\n+\tstrbuf_release(&twobuf);\n }\n \n static void wt_status_print_updated_cb(struct diff_queue_struct *q,\n@@ -205,8 +222,9 @@ static void wt_read_cache(struct wt_status *s)\n static void wt_status_print_initial(struct wt_status *s)\n {\n \tint i;\n-\tchar buf[PATH_MAX];\n+\tstruct strbuf buf;\n \n+\tstrbuf_init(&buf, 0);\n \twt_read_cache(s);\n \tif (active_nr) {\n \t\ts->commitable = 1;\n@@ -215,11 +233,12 @@ static void wt_status_print_initial(struct wt_status *s)\n \tfor (i = 0; i < active_nr; i++) {\n \t\tcolor_fprintf(s->fp, color(WT_STATUS_HEADER), \"#\\t\");\n \t\tcolor_fprintf_ln(s->fp, color(WT_STATUS_UPDATED), \"new file: %s\",\n-\t\t\t\tquote_crlf(active_cache[i]->name,\n-\t\t\t\t\t   buf, sizeof(buf)));\n+\t\t\t\tquote_path(active_cache[i]->name, -1,\n+\t\t\t\t\t   &buf, s->prefix));\n \t}\n \tif (active_nr)\n \t\twt_status_print_trailer(s);\n+\tstrbuf_release(&buf);\n }\n \n static void wt_status_print_updated(struct wt_status *s)\n@@ -254,7 +273,9 @@ static void wt_status_print_untracked(struct wt_status *s)\n \tconst char *x;\n \tint i;\n \tint shown_header = 0;\n+\tstruct strbuf buf;\n \n+\tstrbuf_init(&buf, 0);\n \tmemset(&dir, 0, sizeof(dir));\n \n \tdir.exclude_per_dir = \".gitignore\";\n@@ -291,9 +312,11 @@ static void wt_status_print_untracked(struct wt_status *s)\n \t\t\tshown_header = 1;\n \t\t}\n \t\tcolor_fprintf(s->fp, color(WT_STATUS_HEADER), \"#\\t\");\n-\t\tcolor_fprintf_ln(s->fp, color(WT_STATUS_UNTRACKED), \"%.*s\",\n-\t\t\t\tent->len, ent->name);\n+\t\tcolor_fprintf_ln(s->fp, color(WT_STATUS_UNTRACKED), \"%s\",\n+\t\t\t\tquote_path(ent->name, ent->len,\n+\t\t\t\t\t&buf, s->prefix));\n \t}\n+\tstrbuf_release(&buf);\n }\n \n static void wt_status_print_verbose(struct wt_status *s)\ndiff --git a/wt-status.h b/wt-status.h\nindex 7744932..f58ebcb 100644\n--- a/wt-status.h\n+++ b/wt-status.h\n@@ -23,6 +23,7 @@ struct wt_status {\n \tint workdir_untracked;\n \tconst char *index_file;\n \tFILE *fp;\n+\tconst char *prefix;\n };\n \n int git_status_config(const char *var, const char *value);\n-- \n1.5.3.5.1645.g1f4df\n"},{"id":"59069","messageId":"alpine.LFD.0.999.0711090747210.15101@woody.linux-foundation.org","threadId":"10709","inReplyTo":"9e4733910711071609t3e5412f1mf02e501b2d820bb3@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-11-09T15:54:22Z","receivedAt":"2007-11-09T15:54:22Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Wed, 7 Nov 2007, Jon Smirl wrote:\n> \n> Then why doesn't this work?\n\nJon, lookie here:\n\n> jonsmirl@terra:~/mpc5200b$ git log Documentation\n> all the log for Documentation....\n> jonsmirl@terra:~/mpc5200b$ cd Documentation\n> jonsmirl@terra:~/mpc5200b/Documentation$ git log Documentation\n\nInstead of the above sequence, do:\n\n\tjonsmirl@terra:~/mpc5200b$ ls Documentation\n\t.. all the files in Documentation ..\n\tjonsmirl@terra:~/mpc5200b$ cd Documentation\n\tjonsmirl@terra:~/mpc5200b/Documentation$ ls Documentation\n\nand now tell me, why doesn't that work? And can't you see how *stupid* \nyour complaint is?\n\nThe rule is:\n - git log without arguments gives the whole, unabridged, and full \n   history.\n - git log with arguments gives the *simplified* history for those \n   arguments.\n\nBut the arguments - if they exist - are always relative. You want things \nlike filename completion to work. Making the pathname arguments absolute \nwould be horrible. Think about it: it's just much more logical to always \nbe able to say \"I want the log for file xyz\", and you don't want that to \nbe absolute, since you shouldn't care where in the tree you are.\n\nAnd the fact that git log gives the whole history when you don't give any \narguments at all IN NO WAY makes it any more sensible to give \"absolute\" \npathnames. The history being \"whole\" has nothing to do with the pathnames \nbeing \"absolute\". The two are totally independent issues.\n\n\t\t\tLinus\n"},{"id":"59088","messageId":"9e4733910711090920m6b0b7704x7c5a3849215f385c@mail.gmail.com","threadId":"10709","inReplyTo":"alpine.LFD.0.999.0711090747210.15101@woody.linux-foundation.org","subject":"Re: Inconsistencies with git log","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2007-11-09T17:20:29Z","receivedAt":"2007-11-09T17:20:29Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"On 11/9/07, Linus Torvalds <torvalds@linux-foundation.org> wrote:\n>\n>\n> On Wed, 7 Nov 2007, Jon Smirl wrote:\n> >\n> > Then why doesn't this work?\n>\n> Jon, lookie here:\n>\n> > jonsmirl@terra:~/mpc5200b$ git log Documentation\n> > all the log for Documentation....\n> > jonsmirl@terra:~/mpc5200b$ cd Documentation\n> > jonsmirl@terra:~/mpc5200b/Documentation$ git log Documentation\n>\n> Instead of the above sequence, do:\n>\n>         jonsmirl@terra:~/mpc5200b$ ls Documentation\n>         .. all the files in Documentation ..\n>         jonsmirl@terra:~/mpc5200b$ cd Documentation\n>         jonsmirl@terra:~/mpc5200b/Documentation$ ls Documentation\n>\n> and now tell me, why doesn't that work? And can't you see how *stupid*\n> your complaint is?\n\nI never expected that to work it was just a response to the earlier\nmisstatement that the paths were relative to the project root. It\ndemonstrated that they were not.\n\nThe summary of this is that new users do not expect \"git log\" to give\nthem the whole log when the command is executed in a subdirectory.\nThis causes a training burden because of the unexpected behavior. They\ntry 'git log' and then I have to tell them to use \"git log .\"\n\n>\n> The rule is:\n>  - git log without arguments gives the whole, unabridged, and full\n>    history.\n>  - git log with arguments gives the *simplified* history for those\n>    arguments.\n>\n> But the arguments - if they exist - are always relative. You want things\n> like filename completion to work. Making the pathname arguments absolute\n> would be horrible. Think about it: it's just much more logical to always\n> be able to say \"I want the log for file xyz\", and you don't want that to\n> be absolute, since you shouldn't care where in the tree you are.\n>\n> And the fact that git log gives the whole history when you don't give any\n> arguments at all IN NO WAY makes it any more sensible to give \"absolute\"\n> pathnames. The history being \"whole\" has nothing to do with the pathnames\n> being \"absolute\". The two are totally independent issues.\n>\n>                         Linus\n>\n\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"59092","messageId":"alpine.LFD.0.999.0711090929130.15101@woody.linux-foundation.org","threadId":"10709","inReplyTo":"9e4733910711090920m6b0b7704x7c5a3849215f385c@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-11-09T17:38:32Z","receivedAt":"2007-11-09T17:38:32Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 9 Nov 2007, Jon Smirl wrote:\n> \n> The summary of this is that new users do not expect \"git log\" to give\n> them the whole log when the command is executed in a subdirectory.\n> This causes a training burden because of the unexpected behavior. They\n> try 'git log' and then I have to tell them to use \"git log .\"\n\nNo. The summary is that *you* are confused.\n\nThe fact is, \"git log\" always has given the whole log, and there is no \nconfusion at all. The only people who may be confused are people who \nmisread the documentation on purpose, or who came from some broken other \nSCM, and are confused just because of *that*.\n\nGit makes it very clear indeed at all points that it tracks whole history. \nIt's a big deal. We *make* a big deal about it, and \"git log\" follows that \nvery consistently.\n\nIn fact, even at the top-of-tree, \"git log\" and \"git log .\" are two \ntotally different things, even if in practice the differences are often \nhard to see. But one gives the \"full history\", and the other gives the \n\"simplified history for the pathnames given\", and the two are REALLY \nREALLY different.\n\nTry it. Do\n\n\tgit log origin/pu > full\n\tgit log origin/pu . > limited\n\nin the git tree, and look at the differences (it might be useful to use \ngitk instead, and look at where the differences start! That visual \ndifference is going to give you a lot more of an \"Ahaa!\" moment when you \nunderstand it). When you can explain and understand those differences, \nthen you *really* understand git (and quite frankly, it's actually rather \nsimple, but you have to really *think* about what those things things \nare).\n\nNow, for normal use you never need to really to care. Git does a lot of \nthings, and some random user will seldom need the full power of git, nor \ndo they need to really care about why \"git log .\" and \"git log\" are \nactually not the same thing at all, even at the top level.\n\nBut you're blaming git for your *own* confusion, which probably comes from \ncrap systems that don't even know what \"history\" is because they can't \nreally track it right anyway.\n\n\t\tLinus\n"},{"id":"59093","messageId":"fh263e$6c0$1@ger.gmane.org","threadId":"10709","inReplyTo":"9e4733910711090920m6b0b7704x7c5a3849215f385c@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-11-09T17:41:04Z","receivedAt":"2007-11-09T17:41:04Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Jon Smirl wrote:\n\n> The summary of this is that new users do not expect \"git log\" to give\n> them the whole log when the command is executed in a subdirectory.\n> This causes a training burden because of the unexpected behavior. They\n> try 'git log' and then I have to tell them to use \"git log .\"\n\nThat's too bad, that they have to unlearn bad expectations. Having\n\"git log\" _always_ meaning whole history is very useful. You can always\ndo \"git log .\" (two characters more); how do you propose to request\nfull history from within subdirectory if by default \"git log\" output\nwould limit history to current directory only?\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"59097","messageId":"alpine.LFD.0.999.0711090943120.15101@woody.linux-foundation.org","threadId":"10709","inReplyTo":"alpine.LFD.0.999.0711090929130.15101@woody.linux-foundation.org","subject":"Re: Inconsistencies with git log","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-11-09T17:53:00Z","receivedAt":"2007-11-09T17:53:00Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 9 Nov 2007, Linus Torvalds wrote:\n> \n> In fact, even at the top-of-tree, \"git log\" and \"git log .\" are two \n> totally different things [...]\n\nBtw, the reason (and really the *only* reason) this is interesting at all \nis just to show that the notion of \"full history\" and \"relative pathnames\" \nreally have nothing to do with each other. They really are in totally \ndifferent and orthogonal dimensions.\n\n\"Full history\" is something that exist *independently* of the pathnames. \n\nSo the fact is, \"git log\" on its own is really about the *project*. It is \ntotally pathname-independent, and I'd argue that many people are often \njust interested in the explanations (even though you obviously can also \nsee the patches and the files changed too!) so I seriously doubt that this \nis just an implementation issue or my personal hang-up.\n\nIn other words \"git log\" simply is something *global*. It doesn't matter \nwhere in the tree you are, the end result is the same - it's about the \nproject as a whole.\n\nIn contrast, \"git log <filename>\" is fundamentally different. Now you're \nexplicitly stating that it's not something global any more, and that it's \nabout the *files*. That's also why \"git log\" and \"git log .\" are acually \ndifferent even at the top level.\n\nBecause when you're interested in the files, by implication you're not \ninterested in commits that don't change the files - and there can be such \ncommits even when you give the *total* file list.  \n\n\t\t\tLinus\n"},{"id":"59100","messageId":"9e4733910711091004p6b5dd0c3x2c92148a51dd9927@mail.gmail.com","threadId":"10709","inReplyTo":"alpine.LFD.0.999.0711090943120.15101@woody.linux-foundation.org","subject":"Re: Inconsistencies with git log","fromName":"Jon Smirl","fromEmail":"jonsmirl@gmail.com","sentAt":"2007-11-09T18:04:16Z","receivedAt":"2007-11-09T18:04:16Z","isPatch":false,"sender":{"key":"jonsmirl@gmail.com","avatar":"https://gravatar.com/avatar/cff3bf5bfdfa6708b905712ff91f0f9b8aaca161659f38c02b787920d5d28b7e?d=mp&s=160"},"body":"On 11/9/07, Linus Torvalds <torvalds@linux-foundation.org> wrote:\n>\n>\n> On Fri, 9 Nov 2007, Linus Torvalds wrote:\n> >\n> > In fact, even at the top-of-tree, \"git log\" and \"git log .\" are two\n> > totally different things [...]\n>\n> Btw, the reason (and really the *only* reason) this is interesting at all\n> is just to show that the notion of \"full history\" and \"relative pathnames\"\n> really have nothing to do with each other. They really are in totally\n> different and orthogonal dimensions.\n\nShould \"git log\" and \"git log path\"  have two different command names?\n\n> \"Full history\" is something that exist *independently* of the pathnames.\n>\n> So the fact is, \"git log\" on its own is really about the *project*. It is\n> totally pathname-independent, and I'd argue that many people are often\n> just interested in the explanations (even though you obviously can also\n> see the patches and the files changed too!) so I seriously doubt that this\n> is just an implementation issue or my personal hang-up.\n>\n> In other words \"git log\" simply is something *global*. It doesn't matter\n> where in the tree you are, the end result is the same - it's about the\n> project as a whole.\n>\n> In contrast, \"git log <filename>\" is fundamentally different. Now you're\n> explicitly stating that it's not something global any more, and that it's\n> about the *files*. That's also why \"git log\" and \"git log .\" are acually\n> different even at the top level.\n>\n> Because when you're interested in the files, by implication you're not\n> interested in commits that don't change the files - and there can be such\n> commits even when you give the *total* file list.\n>\n>                         Linus\n>\n\n\n-- \nJon Smirl\njonsmirl@gmail.com\n"},{"id":"59103","messageId":"alpine.LFD.0.999.0711091009250.15101@woody.linux-foundation.org","threadId":"10709","inReplyTo":"9e4733910711091004p6b5dd0c3x2c92148a51dd9927@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-11-09T18:14:09Z","receivedAt":"2007-11-09T18:14:09Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 9 Nov 2007, Jon Smirl wrote:\n> \n> Should \"git log\" and \"git log path\"  have two different command names?\n\nDo you think that would really help?\n\nWe actually have people complaining about the numebr of git commands \nalready. And the thing is, \"git log\" is actually what things like \"gitk\" \nuse to visualize the history, and all *those* commands want the two \ndifferent modes too! You want a \"global history\" view in gitk, but you \nalso want a \"file limited view\". So having two different commands is \nactually what people absolutely DO NOT want.\n\nOn the same note: several git commands have totally different fundamental \nbehaviour based on arguments - in ways even more different than \"git log\". \nAt least \"git log\" always shows a log, the arguments just change what \n*part* of the log they show.\n\nFor example, think about \"git checkout\": you can use it to check out \nindividual files and directories, but you can obviously use it to switch \nbranches (and create them!) too.  That's actually a much bigger difference \nthan the different modes of \"git log\", but considering how many people \nhave complained about \"many different commands\", I think people seem to be \nhappier with commands that do somewhat related things just depending on \nthe kinds of arguments they get.\n\n\t\tLinus\n"},{"id":"59105","messageId":"20071109182248.GD28800@xp.machine.xx","threadId":"10709","inReplyTo":"alpine.LFD.0.999.0711090943120.15101@woody.linux-foundation.org","subject":"Re: Inconsistencies with git log","fromName":"Peter Baumann","fromEmail":"waste.manager@gmx.de","sentAt":"2007-11-09T18:22:48Z","receivedAt":"2007-11-09T18:22:48Z","isPatch":false,"sender":{"key":"waste.manager@gmx.de","avatar":null},"body":"On Fri, Nov 09, 2007 at 09:53:00AM -0800, Linus Torvalds wrote:\n> \n> \n> On Fri, 9 Nov 2007, Linus Torvalds wrote:\n> > \n> > In fact, even at the top-of-tree, \"git log\" and \"git log .\" are two \n> > totally different things [...]\n> \n> Btw, the reason (and really the *only* reason) this is interesting at all \n> is just to show that the notion of \"full history\" and \"relative pathnames\" \n> really have nothing to do with each other. They really are in totally \n> different and orthogonal dimensions.\n> \n> \"Full history\" is something that exist *independently* of the pathnames. \n> \n> So the fact is, \"git log\" on its own is really about the *project*. It is \n> totally pathname-independent, and I'd argue that many people are often \n> just interested in the explanations (even though you obviously can also \n> see the patches and the files changed too!) so I seriously doubt that this \n> is just an implementation issue or my personal hang-up.\n> \n> In other words \"git log\" simply is something *global*. It doesn't matter \n> where in the tree you are, the end result is the same - it's about the \n> project as a whole.\n> \n> In contrast, \"git log <filename>\" is fundamentally different. Now you're \n> explicitly stating that it's not something global any more, and that it's \n> about the *files*. That's also why \"git log\" and \"git log .\" are acually \n> different even at the top level.\n> \n> Because when you're interested in the files, by implication you're not \n> interested in commits that don't change the files - and there can be such \n> commits even when you give the *total* file list.  \n> \n\nHm. I tried to run your 'git log' and 'git log .' example and a diff\nrevealed that the output of those two isn't the same, contrary to what I\nthought.\n\nIn the 'git-log .' case, there should be done a history simplification,\nbut then only commits which don't change anything are pruned and AFAIR\n'git commit' doesn't allow this. Using core git, one could create commits\nwith the same tree as their parent, but I don't think that all the commits\nwhich get removed in the '.' case where produced that way. There has to be\nanother case I can't figure out.\n\nA little confused,\nPeter\n"},{"id":"59107","messageId":"7vd4ujtgh7.fsf@gitster.siamese.dyndns.org","threadId":"10709","inReplyTo":"20071109182248.GD28800@xp.machine.xx","subject":"Re: Inconsistencies with git log","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-11-09T18:35:00Z","receivedAt":"2007-11-09T18:35:00Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Peter Baumann <waste.manager@gmx.de> writes:\n\n> Hm. I tried to run your 'git log' and 'git log .' example and a diff\n> revealed that the output of those two isn't the same, contrary to what I\n> thought.\n>\n> In the 'git-log .' case, there should be done a history simplification,\n> but then only commits which don't change anything are pruned and AFAIR\n> 'git commit' doesn't allow this. Using core git, one could create commits\n> with the same tree as their parent, but I don't think that all the commits\n> which get removed in the '.' case where produced that way. There has to be\n> another case I can't figure out.\n\nThe answer is \"merges\".\n\nIf a merge does not change the tree from one of the ancestors,\nthe side branches are pruned out, to give you _one_ explanation\nof how you got there.  And by pruning such side branches, you\nget the simpler explanation.\n\nLinus gave the example of \"log origin/pu .\"; there is at least\none merge I am aware of that did not change any path (it is the\none that merges \"jc/maint-format-patch-encoding\" topic).  With\nthe path limiter, the merge commit and the two commits that\nleads to it on the side branch are hidden away.\n"},{"id":"59108","messageId":"alpine.LFD.0.999.0711091029160.15101@woody.linux-foundation.org","threadId":"10709","inReplyTo":"20071109182248.GD28800@xp.machine.xx","subject":"Re: Inconsistencies with git log","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-11-09T18:36:28Z","receivedAt":"2007-11-09T18:36:28Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Fri, 9 Nov 2007, Peter Baumann wrote:\n> \n> Hm. I tried to run your 'git log' and 'git log .' example and a diff\n> revealed that the output of those two isn't the same, contrary to what I\n> thought.\n\nBtw, you can *make* them the same by using\n\n\tgit log --full-history --sparse .\n\nwhich basically tells git that you do not want any of the history \nsimplification that git log does by default.\n\nThere's two different kinds of simplifications (which is why there are two \nkinds of switches above):\n\n - the \"simplify merges to just the parent that is identical\"\n\n   This basically means that if a merge result comes 100% from one of the \n   parents, by default we will only look at that parent. Using \n   --full-history avoids this.\n\n - the \"dense\" history, which removes simple commits that don't make any \n   changes\n\n   This is the \"--sparse\" thing: it says that we're interested even in \n   regular commits that simply don't make any changes.\n\n> In the 'git-log .' case, there should be done a history simplification,\n> but then only commits which don't change anything are pruned and AFAIR\n> 'git commit' doesn't allow this.\n\nActually, git itself creates these commits under several circumstances:\n\n - you can *force* it. No, \"git commit\" on its own doesn't allow it, but \n   you can do it quite easily with \"git commit-tree\" and setting things \n   up by hand.\n\n - you can import history from other SCM's. I think all importers will \n   honor other SCM's, and if they allow empty commits then the end result \n   will have empty commits in it too!\n\n - merges. This is the common case. You have a \"git merge --ours\" or \n   similar, which basically merges just one side (or, even without \n   \"--ours\", this is really common for the non-\".\" case: a merge just \n   doesn't touch some files at all). Then, the merge simplifier will first \n   turn it into a \"single parent\", and then densification will remove that \n   (now uninteresting) empty merge.\n\n> Using core git, one could create commits with the same tree as their \n> parent, but I don't think that all the commits which get removed in the \n> '.' case where produced that way. There has to be another case I can't \n> figure out.\n\nSee above. Three cases, in fact.\n\n\t\tLinus\n"},{"id":"59110","messageId":"fh29e4$i6v$1@ger.gmane.org","threadId":"10709","inReplyTo":"7vd4ujtgh7.fsf@gitster.siamese.dyndns.org","subject":"Re: Inconsistencies with git log","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-11-09T18:37:58Z","receivedAt":"2007-11-09T18:37:58Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Junio C Hamano wrote:\n\n> Peter Baumann <waste.manager@gmx.de> writes:\n> \n>> Hm. I tried to run your 'git log' and 'git log .' example and a diff\n>> revealed that the output of those two isn't the same, contrary to what I\n>> thought.\n>>\n>> In the 'git-log .' case, there should be done a history simplification,\n>> but then only commits which don't change anything are pruned and AFAIR\n>> 'git commit' doesn't allow this. Using core git, one could create commits\n>> with the same tree as their parent, but I don't think that all the commits\n>> which get removed in the '.' case where produced that way. There has to be\n>> another case I can't figure out.\n> \n> The answer is \"merges\".\n> \n> If a merge does not change the tree from one of the ancestors,\n> the side branches are pruned out, to give you _one_ explanation\n> of how you got there.  And by pruning such side branches, you\n> get the simpler explanation.\n> \n> Linus gave the example of \"log origin/pu .\"; there is at least\n> one merge I am aware of that did not change any path (it is the\n> one that merges \"jc/maint-format-patch-encoding\" topic).  With\n> the path limiter, the merge commit and the two commits that\n> leads to it on the side branch are hidden away.\n\nDoes it mean that \"git log\" and \"git log --full-history .\" produce\nthe same output?\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"59111","messageId":"20071109183943.GE28800@xp.machine.xx","threadId":"10709","inReplyTo":"7vd4ujtgh7.fsf@gitster.siamese.dyndns.org","subject":"Re: Inconsistencies with git log","fromName":"Peter Baumann","fromEmail":"waste.manager@gmx.de","sentAt":"2007-11-09T18:39:43Z","receivedAt":"2007-11-09T18:39:43Z","isPatch":false,"sender":{"key":"waste.manager@gmx.de","avatar":null},"body":"On Fri, Nov 09, 2007 at 10:35:00AM -0800, Junio C Hamano wrote:\n> Peter Baumann <waste.manager@gmx.de> writes:\n> \n> > Hm. I tried to run your 'git log' and 'git log .' example and a diff\n> > revealed that the output of those two isn't the same, contrary to what I\n> > thought.\n> >\n> > In the 'git-log .' case, there should be done a history simplification,\n> > but then only commits which don't change anything are pruned and AFAIR\n> > 'git commit' doesn't allow this. Using core git, one could create commits\n> > with the same tree as their parent, but I don't think that all the commits\n> > which get removed in the '.' case where produced that way. There has to be\n> > another case I can't figure out.\n> \n> The answer is \"merges\".\n> \n> If a merge does not change the tree from one of the ancestors,\n> the side branches are pruned out, to give you _one_ explanation\n> of how you got there.  And by pruning such side branches, you\n> get the simpler explanation.\n> \n> Linus gave the example of \"log origin/pu .\"; there is at least\n> one merge I am aware of that did not change any path (it is the\n> one that merges \"jc/maint-format-patch-encoding\" topic).  With\n> the path limiter, the merge commit and the two commits that\n> leads to it on the side branch are hidden away.\n\nDoh. Could have figured this out myself. But thank your for the explanation.\n\n-Peter\n"},{"id":"59201","messageId":"fh46vv$ooj$1@ger.gmane.org","threadId":"10709","inReplyTo":"Pine.LNX.4.64.0711091529570.4362@racer.site","subject":"Re: [PATCH REPLACEMENT for 2/2] git status: show relative paths when run in a subdirectory","fromName":"Michel Marti","fromEmail":"mma@objectxp.com","sentAt":"2007-11-10T12:08:30Z","receivedAt":"2007-11-10T12:08:30Z","isPatch":true,"sender":{"key":"mma@objectxp.com","avatar":null},"body":"Untracked files in the current dir don't include the relative path \nto the project-root, but changed/updated files do:\n\n# Changes to be committed:\n#   (use \"git reset HEAD <file>...\" to unstage)\n#\n#       new file: ../subdir/hello\n#\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n#       world\n\nWith the patch below (on top of your changes), the output becomes\n\n# Changes to be committed:\n#   (use \"git reset HEAD <file>...\" to unstage)\n#\n#       new file: hello\n#\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n#       world\n\nCheers,\n\n- Michel\n\ndiff --git a/wt-status.c b/wt-status.c\nindex 0d25362..2cdc8ce 100644\n--- a/wt-status.c\n+++ b/wt-status.c\n@@ -133,8 +133,8 @@ static void wt_status_print_filepair(struct wt_status *s,\n \n        strbuf_init(&onebuf, 0);\n        strbuf_init(&twobuf, 0);\n-       one = quote_path(p->one->path, -1, &onebuf, s->prefix);\n-       two = quote_path(p->two->path, -1, &twobuf, s->prefix);\n+       one = quote_path(p->one->path, strlen(p->one->path), &onebuf, s->prefix);\n+       two = quote_path(p->two->path, strlen(p->two->path), &twobuf, s->prefix);\n \n        color_fprintf(s->fp, color(WT_STATUS_HEADER), \"#\\t\");\n        switch (p->status) {\n@@ -233,7 +233,8 @@ static void wt_status_print_initial(struct wt_status *s)\n        for (i = 0; i < active_nr; i++) {\n                color_fprintf(s->fp, color(WT_STATUS_HEADER), \"#\\t\");\n                color_fprintf_ln(s->fp, color(WT_STATUS_UPDATED), \"new file: %s\",\n-                               quote_path(active_cache[i]->name, -1,\n+                               quote_path(active_cache[i]->name,\n+                                       strlen(active_cache[i]->name),\n                                           &buf, s->prefix));\n        }\n        if (active_nr)\n"},{"id":"59215","messageId":"Pine.LNX.4.64.0711101401370.4362@racer.site","threadId":"10709","inReplyTo":"fh46vv$ooj$1@ger.gmane.org","subject":"Re: [PATCH REPLACEMENT for 2/2] git status: show relative paths when run in a subdirectory","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-10T14:10:00Z","receivedAt":"2007-11-10T14:10:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nplease, please, please do not cull the Cc list.  I consider it rude to \nreply to _me_, but _address_ the mail to me, either the To: (preferred) or \nthe Cc: (not so preferred).\n\nOn Sat, 10 Nov 2007, Michel Marti wrote:\n\n> Untracked files in the current dir don't include the relative path \n> to the project-root, but changed/updated files do:\n> \n> # Changes to be committed:\n> #   (use \"git reset HEAD <file>...\" to unstage)\n> #\n> #       new file: ../subdir/hello\n> #\n> # Untracked files:\n> #   (use \"git add <file>...\" to include in what will be committed)\n> #\n> #       world\n> \n> With the patch below (on top of your changes), the output becomes\n> \n> # Changes to be committed:\n> #   (use \"git reset HEAD <file>...\" to unstage)\n> #\n> #       new file: hello\n> #\n> # Untracked files:\n> #   (use \"git add <file>...\" to include in what will be committed)\n> #\n> #       world\n> \n> Cheers,\n> \n> - Michel\n> \n> diff --git a/wt-status.c b/wt-status.c\n> index 0d25362..2cdc8ce 100644\n> --- a/wt-status.c\n> +++ b/wt-status.c\n> @@ -133,8 +133,8 @@ static void wt_status_print_filepair(struct wt_status *s,\n>  \n>         strbuf_init(&onebuf, 0);\n>         strbuf_init(&twobuf, 0);\n> -       one = quote_path(p->one->path, -1, &onebuf, s->prefix);\n> -       two = quote_path(p->two->path, -1, &twobuf, s->prefix);\n> +       one = quote_path(p->one->path, strlen(p->one->path), &onebuf, s->prefix);\n> +       two = quote_path(p->two->path, strlen(p->two->path), &twobuf, s->prefix);\n>  \n>         color_fprintf(s->fp, color(WT_STATUS_HEADER), \"#\\t\");\n>         switch (p->status) {\n> @@ -233,7 +233,8 @@ static void wt_status_print_initial(struct wt_status *s)\n>         for (i = 0; i < active_nr; i++) {\n>                 color_fprintf(s->fp, color(WT_STATUS_HEADER), \"#\\t\");\n>                 color_fprintf_ln(s->fp, color(WT_STATUS_UPDATED), \"new file: %s\",\n> -                               quote_path(active_cache[i]->name, -1,\n> +                               quote_path(active_cache[i]->name,\n> +                                       strlen(active_cache[i]->name),\n>                                            &buf, s->prefix));\n>         }\n>         if (active_nr)\n> \n\nThis patch is wrong.\n\nIf you want to go that way, move the strlen() call _into_ quote_path(), \nlike I had it earlier.\n\nBut then we will have a double traversal of the strings again.  That's \nwhat I tried to avoid, but I missed one place:\n\nIn line 94, it says \"... && off < len && ...\".  This should read something \nlike \"((len < 0 && !in[off]) || off < len)\" instead.  Or maybe even \"(len \n< 0 || off < len)\" and have an \"} else if (in[off]) off++; else break;\" in \nthe loop block.\n\nBesides, you completely ignored the nice examples how other people \ncontribute their patches, with mail bodies that double as a commit \nmessage, a diffstat, and with a test case.\n\nHth,\nDscho\n"},{"id":"59250","messageId":"87d4uhaf3o.fsf@catnip.gol.com","threadId":"10709","inReplyTo":"9e4733910711071503va92a653s25fd978989d5917d@mail.gmail.com","subject":"Re: Inconsistencies with git log","fromName":"Miles Bader","fromEmail":"miles@gnu.org","sentAt":"2007-11-10T22:51:55Z","receivedAt":"2007-11-10T22:51:55Z","isPatch":false,"sender":{"key":"miles@gnu.org","avatar":"https://gravatar.com/avatar/01069b69593af7bff28e2f97afeb3644ae6fe2f5f56cb3a8cf34c5fb8c36efe5?d=mp&s=160"},"body":"\"Jon Smirl\" <jonsmirl@gmail.com> writes:\n> But if you type 'git log' while cd'd into a subdirectory the whole log\n> is almost never what you want. It's this kind of thing that makes git\n> harder to use.\n\nActually I almost always want the \"whole project history\" when cd'd to a\nsubdir.\n\nGit's convention of doing the whole project by default, but allowing \".\"\n(or any other directory name) to narrow it down seems almost perfect to\nme.\n\n-Miles\n\n-- \n\"Don't just question authority,\nDon't forget to question me.\"\n-- Jello Biafra\n"}]}