{"thread":{"id":"11095","subject":"Difference in how \"git status\" and \"git diff --name-only\" lists filenames","startedAt":"2007-12-02T14:04:06Z","lastAt":"2007-12-06T16:36:02Z","messageCount":3,"participants":["Gustaf Hendeby","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"61641","messageId":"bf7b2dda0712020604x209d6665i9ab58b32834b2cee@mail.gmail.com","threadId":"11095","inReplyTo":null,"subject":"Difference in how \"git status\" and \"git diff --name-only\" lists filenames","fromName":"Gustaf Hendeby","fromEmail":"hendeby@gmail.com","sentAt":"2007-12-02T14:04:06Z","receivedAt":"2007-12-02T14:04:06Z","isPatch":false,"sender":{"key":"hendeby@gmail.com","avatar":null},"body":"A while ago 'git status' was patched to report relative pathnames.  (I\nlike that change it makes cut'n'paste easier.)  However, 'git diff\n--name-only' and 'git diff --name-status' (other commands as well),\nwhich gives in a sense similar output has not been changed the same\nway.  Is this intentionally, or just because no one has stepped up and\nprovided a patch?  If the difference is to stay, maybe this should be\nreflected in the help texts to avoid any confusion.\n\n/Gustaf\n"},{"id":"61669","messageId":"7vodd9x7fu.fsf@gitster.siamese.dyndns.org","threadId":"11095","inReplyTo":"bf7b2dda0712020604x209d6665i9ab58b32834b2cee@mail.gmail.com","subject":"Re: Difference in how \"git status\" and \"git diff --name-only\" lists filenames","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-12-02T18:44:37Z","receivedAt":"2007-12-02T18:44:37Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Gustaf Hendeby\" <hendeby@gmail.com> writes:\n\n> A while ago 'git status' was patched to report relative pathnames.  (I\n> like that change it makes cut'n'paste easier.)  However, 'git diff\n> --name-only' and 'git diff --name-status' (other commands as well),\n> which gives in a sense similar output has not been changed the same\n> way.  Is this intentionally, or just because no one has stepped up and\n> provided a patch?  If the difference is to stay, maybe this should be\n> reflected in the help texts to avoid any confusion.\n\nThe commands output from diff always talks about paths relative to the\ntree root, and scripts rely on it.  The recent change made exceptions to\nthe status command.  I agree an additional documentation to git-status\nwould be beneficial.\n\nHaving said that, a switch --relative-name might be an option.  It could\nbe argued that doing it the other way around (like --full-name option to\nls-files does), defaulting to relative to cwd, would have been a getter\napproach if we were doing git from scratch, though.  We may still want\nto do so in the longer run, but that would be a huge interface change\nthat would impact a lot of peoples' scripts.\n\n\ndiff --git a/Documentation/git-status.txt b/Documentation/git-status.txt\nindex 8fd0fc6..b0cb6bc 100644\n--- a/Documentation/git-status.txt\n+++ b/Documentation/git-status.txt\n@@ -40,6 +40,10 @@ OUTPUT\n The output from this command is designed to be used as a commit\n template comments, and all the output lines are prefixed with '#'.\n \n+The paths mentioned in the output, unlike many other git commands, are\n+made relative to the current directory, if you are working in a\n+subdirectory (this is on purpose, to help cutting and pasting).\n+\n \n CONFIGURATION\n -------------\n"},{"id":"62163","messageId":"bf7b2dda0712060836j530277d5x28fcb50a717f17e5@mail.gmail.com","threadId":"11095","inReplyTo":"7vodd9x7fu.fsf@gitster.siamese.dyndns.org","subject":"Re: Difference in how \"git status\" and \"git diff --name-only\" lists filenames","fromName":"Gustaf Hendeby","fromEmail":"hendeby@gmail.com","sentAt":"2007-12-06T16:36:02Z","receivedAt":"2007-12-06T16:36:02Z","isPatch":false,"sender":{"key":"hendeby@gmail.com","avatar":null},"body":"On Dec 2, 2007 7:44 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> \"Gustaf Hendeby\" <hendeby@gmail.com> writes:\n> > A while ago 'git status' was patched to report relative pathnames.  (I\n> > like that change it makes cut'n'paste easier.)  However, 'git diff\n> > --name-only' and 'git diff --name-status' (other commands as well),\n> > which gives in a sense similar output has not been changed the same\n> > way.  Is this intentionally, or just because no one has stepped up and\n> > provided a patch?  If the difference is to stay, maybe this should be\n> > reflected in the help texts to avoid any confusion.\n>\n> The commands output from diff always talks about paths relative to the\n> tree root, and scripts rely on it.  The recent change made exceptions to\n> the status command.  I agree an additional documentation to git-status\n> would be beneficial.\n>\n> Having said that, a switch --relative-name might be an option.  It could\n> be argued that doing it the other way around (like --full-name option to\n> ls-files does), defaulting to relative to cwd, would have been a getter\n> approach if we were doing git from scratch, though.  We may still want\n> to do so in the longer run, but that would be a huge interface change\n> that would impact a lot of peoples' scripts.\n>\n>\n> diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt\n> index 8fd0fc6..b0cb6bc 100644\n> --- a/Documentation/git-status.txt\n> +++ b/Documentation/git-status.txt\n> @@ -40,6 +40,10 @@ OUTPUT\n>  The output from this command is designed to be used as a commit\n>  template comments, and all the output lines are prefixed with '#'.\n>\n> +The paths mentioned in the output, unlike many other git commands, are\n> +made relative to the current directory, if you are working in a\n> +subdirectory (this is on purpose, to help cutting and pasting).\n> +\n>\n>  CONFIGURATION\n>  -------------\n>\n\nThank you for your timely answer and the good explanation.  Sorry for\nmy late response!  I think that the addition to the documentation that\nyou suggest sounds good, and would be useful.  Do you want me to do\nanything else about this?\n\n/Gustaf\n"}]}