git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Difference in how "git status" and "git diff --name-only" lists filenames
@ 2007-12-02 14:04 Gustaf Hendeby
  2007-12-02 18:44 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Gustaf Hendeby @ 2007-12-02 14:04 UTC (permalink / raw)
  To: git

A while ago 'git status' was patched to report relative pathnames.  (I
like that change it makes cut'n'paste easier.)  However, 'git diff
--name-only' and 'git diff --name-status' (other commands as well),
which gives in a sense similar output has not been changed the same
way.  Is this intentionally, or just because no one has stepped up and
provided a patch?  If the difference is to stay, maybe this should be
reflected in the help texts to avoid any confusion.

/Gustaf

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Difference in how "git status" and "git diff --name-only" lists filenames
  2007-12-02 14:04 Difference in how "git status" and "git diff --name-only" lists filenames Gustaf Hendeby
@ 2007-12-02 18:44 ` Junio C Hamano
  2007-12-06 16:36   ` Gustaf Hendeby
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2007-12-02 18:44 UTC (permalink / raw)
  To: Gustaf Hendeby; +Cc: git

"Gustaf Hendeby" <hendeby@gmail.com> writes:

> A while ago 'git status' was patched to report relative pathnames.  (I
> like that change it makes cut'n'paste easier.)  However, 'git diff
> --name-only' and 'git diff --name-status' (other commands as well),
> which gives in a sense similar output has not been changed the same
> way.  Is this intentionally, or just because no one has stepped up and
> provided a patch?  If the difference is to stay, maybe this should be
> reflected in the help texts to avoid any confusion.

The commands output from diff always talks about paths relative to the
tree root, and scripts rely on it.  The recent change made exceptions to
the status command.  I agree an additional documentation to git-status
would be beneficial.

Having said that, a switch --relative-name might be an option.  It could
be argued that doing it the other way around (like --full-name option to
ls-files does), defaulting to relative to cwd, would have been a getter
approach if we were doing git from scratch, though.  We may still want
to do so in the longer run, but that would be a huge interface change
that would impact a lot of peoples' scripts.


diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
index 8fd0fc6..b0cb6bc 100644
--- a/Documentation/git-status.txt
+++ b/Documentation/git-status.txt
@@ -40,6 +40,10 @@ OUTPUT
 The output from this command is designed to be used as a commit
 template comments, and all the output lines are prefixed with '#'.
 
+The paths mentioned in the output, unlike many other git commands, are
+made relative to the current directory, if you are working in a
+subdirectory (this is on purpose, to help cutting and pasting).
+
 
 CONFIGURATION
 -------------

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: Difference in how "git status" and "git diff --name-only" lists filenames
  2007-12-02 18:44 ` Junio C Hamano
@ 2007-12-06 16:36   ` Gustaf Hendeby
  0 siblings, 0 replies; 3+ messages in thread
From: Gustaf Hendeby @ 2007-12-06 16:36 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Dec 2, 2007 7:44 PM, Junio C Hamano <gitster@pobox.com> wrote:
> "Gustaf Hendeby" <hendeby@gmail.com> writes:
> > A while ago 'git status' was patched to report relative pathnames.  (I
> > like that change it makes cut'n'paste easier.)  However, 'git diff
> > --name-only' and 'git diff --name-status' (other commands as well),
> > which gives in a sense similar output has not been changed the same
> > way.  Is this intentionally, or just because no one has stepped up and
> > provided a patch?  If the difference is to stay, maybe this should be
> > reflected in the help texts to avoid any confusion.
>
> The commands output from diff always talks about paths relative to the
> tree root, and scripts rely on it.  The recent change made exceptions to
> the status command.  I agree an additional documentation to git-status
> would be beneficial.
>
> Having said that, a switch --relative-name might be an option.  It could
> be argued that doing it the other way around (like --full-name option to
> ls-files does), defaulting to relative to cwd, would have been a getter
> approach if we were doing git from scratch, though.  We may still want
> to do so in the longer run, but that would be a huge interface change
> that would impact a lot of peoples' scripts.
>
>
> diff --git a/Documentation/git-status.txt b/Documentation/git-status.txt
> index 8fd0fc6..b0cb6bc 100644
> --- a/Documentation/git-status.txt
> +++ b/Documentation/git-status.txt
> @@ -40,6 +40,10 @@ OUTPUT
>  The output from this command is designed to be used as a commit
>  template comments, and all the output lines are prefixed with '#'.
>
> +The paths mentioned in the output, unlike many other git commands, are
> +made relative to the current directory, if you are working in a
> +subdirectory (this is on purpose, to help cutting and pasting).
> +
>
>  CONFIGURATION
>  -------------
>

Thank you for your timely answer and the good explanation.  Sorry for
my late response!  I think that the addition to the documentation that
you suggest sounds good, and would be useful.  Do you want me to do
anything else about this?

/Gustaf

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-12-06 16:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-02 14:04 Difference in how "git status" and "git diff --name-only" lists filenames Gustaf Hendeby
2007-12-02 18:44 ` Junio C Hamano
2007-12-06 16:36   ` Gustaf Hendeby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).