Re: [PATCH 5/5] git-diff.txt: fix ordering of the [--no-index] form

2013-04-24 Thread Ramkumar Ramachandra
Jonathan Nieder wrote:
> What would that configuration variable even mean?  "Set this to make
> other people's scripts work when they assume --no-index won't be
> triggered automatically"?

No.  "Set this for interactive use".
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] git-diff.txt: fix ordering of the [--no-index] form

2013-04-24 Thread Jonathan Nieder
Ramkumar Ramachandra wrote:

> I completely disagree, but we don't have to agree: make it a
> configuration variable.

I thought we had discussed before how every configuration variable
costs quite a lot in terms of Git's teachability.

What would that configuration variable even mean?  "Set this to make
other people's scripts work when they assume --no-index won't be
triggered automatically"?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] git-diff.txt: fix ordering of the [--no-index] form

2013-04-24 Thread Ramkumar Ramachandra
Jonathan Nieder wrote:
>  * hard to document
> [...]

I completely disagree, but we don't have to agree: make it a
configuration variable.  Even if it's turned to "never" by default, I
don't mind having one extra line in my .gitconfig.  But you went all
"Oh please no" when I brought it up.  I thought you were claiming that
nobody finds it useful.  Now, you seem to be claiming that people who
find it useful must suffer.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] git-diff.txt: fix ordering of the [--no-index] form

2013-04-24 Thread Jonathan Nieder
Ramkumar Ramachandra wrote:
> Jonathan Nieder wrote:

>> Because typing paths does not make my intent perfectly clear.
>
> I'm not able to understand this.  Doesn't your prompt tell you which
> directory you're in, and if you're in a git repository?  When you type
> out paths, you know what is inside and what is outside your
> repository.  By extension, you know when --no-index is implied and
> when it isn't.
>
> Can you explain what your problem is?

Are you wondering why I use --no-index or why I think we should
eventually stop moving into --no-index mode by default?

The answers are different.  I use --no-index because it means I don't
have to think about whether the files I am comparing are in a Git
repository.  It's relaxing.  I'm not advocating that you follow suit;
I'm just describing my own usage of the command.

I think git should eventually stop doing --no-index implicitly because
it is a very different mode using the same syntax triggered by
external conditions.  That is

 * hard to document
 * problematic for scripts calling "git diff", can create lurking bugs
 * unnecessarily complicated.  For example:
   * "git diff -h" output depends on whether I am in a git worktree.
   * git searches for a .git directory, possibly hitting filesystem
 automount points, just to decide whether its arguments are inside
 the current repository.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] git-diff.txt: fix ordering of the [--no-index] form

2013-04-24 Thread Ramkumar Ramachandra
Jonathan Nieder wrote:
> Because typing paths does not make my intent perfectly clear.

I'm not able to understand this.  Doesn't your prompt tell you which
directory you're in, and if you're in a git repository?  When you type
out paths, you know what is inside and what is outside your
repository.  By extension, you know when --no-index is implied and
when it isn't.

Can you explain what your problem is?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] git-diff.txt: fix ordering of the [--no-index] form

2013-04-24 Thread Jonathan Nieder
Ramkumar Ramachandra wrote:
> Jonathan Nieder wrote:

>> Oh please no.
>
> If I understand this correctly, you are horrified by this?
> https://github.com/artagnon/dotfiles/blob/master/.gitconfig#L30

Nope, that looks like a useful way to save typing, and "git help"
helpfully expands any of your custom commands when you want to
translate in order to help other people.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] git-diff.txt: fix ordering of the [--no-index] form

2013-04-24 Thread Ramkumar Ramachandra
Jonathan Nieder wrote:
> Oh please no.

If I understand this correctly, you are horrified by this?
https://github.com/artagnon/dotfiles/blob/master/.gitconfig#L30

By the way, my zsh aliases git to g.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] git-diff.txt: fix ordering of the [--no-index] form

2013-04-24 Thread Jonathan Nieder
Ramkumar Ramachandra wrote:
> Jonathan Nieder wrote:

>> Maybe it would make sense to move towards eliminating the "implicit
>> --no-index for paths outside the repository" trick.  I use "git diff
>> --no-index" all the time, but I always spell it out to be careful.
>
> Huh?  Why do you want to endure the pain of spelling it out, when your
> intent is perfectly clear?

Because typing paths does not make my intent perfectly clear.

> What would make sense is a tristate diff.no-index:

Oh please no.

Hope that helps,
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] git-diff.txt: fix ordering of the [--no-index] form

2013-04-24 Thread Ramkumar Ramachandra
Jonathan Nieder wrote:
> Maybe it would make sense to move towards eliminating the "implicit
> --no-index for paths outside the repository" trick.  I use "git diff
> --no-index" all the time, but I always spell it out to be careful.

Huh?  Why do you want to endure the pain of spelling it out, when your
intent is perfectly clear?

What would make sense is a tristate diff.no-index:
inside-worktree|outside-worktree|always.  I don't know why we should
even have a "never".
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] git-diff.txt: fix ordering of the [--no-index] form

2013-04-24 Thread Jonathan Nieder
Ramkumar Ramachandra wrote:

>  The form is a special case of
> the first form where the number of paths are limited to two.  Besides,
> isn't that how the DESCRIPTION section explains it now?

Sort of.  It's a completely different form, but when --no-index is
left out the syntax is a special case of "git diff -- ...".

Maybe it would make sense to move towards eliminating the "implicit
--no-index for paths outside the repository" trick.  I use "git diff
--no-index" all the time, but I always spell it out to be careful.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] git-diff.txt: fix ordering of the [--no-index] form

2013-04-24 Thread Ramkumar Ramachandra
Junio C Hamano wrote:
> The "--no-index" mode was a hack to allow "git diff" goodies to be
> used outside the context of "git", and a proper execution of it
> should have been to send patches to GNU or BSD diff maintainers, not
> to add the "--no-index" option that is unrelated to "git" to our
> code.

Yeah, I know.  I use it instead of diff all the time.

> I think it is more correct to list it as a footnote and list
> separately from the main text, which is what the original SYNOPSIS
> section does.

I was trying to be more "correct" here.  The form is a special case of
the first form where the number of paths are limited to two.  Besides,
isn't that how the DESCRIPTION section explains it now?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] git-diff.txt: fix ordering of the [--no-index] form

2013-04-24 Thread Junio C Hamano
Ramkumar Ramachandra  writes:

> The SYNOPSIS lists the [--no-index] form as the last item, but the
> DESCRIPTION lists it as a natural extension of the first form.

Perhaps either the description or your reading is wrong.

The "--no-index" mode was a hack to allow "git diff" goodies to be
used outside the context of "git", and a proper execution of it
should have been to send patches to GNU or BSD diff maintainers, not
to add the "--no-index" option that is unrelated to "git" to our
code.

I think it is more correct to list it as a footnote and list
separately from the main text, which is what the original SYNOPSIS
section does.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/5] git-diff.txt: fix ordering of the [--no-index] form

2013-04-24 Thread Ramkumar Ramachandra
The SYNOPSIS lists the [--no-index] form as the last item, but the
DESCRIPTION lists it as a natural extension of the first form.  Fix
this with a reordering.  Also since the DESCRIPTION breaks up the
first form in the SYNOPSIS into two different forms (one without the
optional [], and the other with it), reorder to make these two
forms appear together.

Signed-off-by: Ramkumar Ramachandra 
---
 Documentation/git-diff.txt | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/Documentation/git-diff.txt b/Documentation/git-diff.txt
index 291e250..1f2f681 100644
--- a/Documentation/git-diff.txt
+++ b/Documentation/git-diff.txt
@@ -10,12 +10,12 @@ SYNOPSIS
 
 [verse]
 'git diff' [options] [] [[--] [...]]
+'git diff' [options] [--no-index] [[--]  ]
 'git diff' [options] --cached [] [[--] [...]]
 'git diff' [options]  
 'git diff' [options]   [[--] [...]]
 'git diff' [options] .. [[--] [...]]
 'git diff' [options] \... [[--] [...]]
-'git diff' [options] [--no-index] [[--]  ]
 
 DESCRIPTION
 ---
@@ -35,6 +35,14 @@ If exactly two paths are given and at least one points 
outside
 the current repository, 'git diff' will compare the two files /
 directories. This behavior can be forced by --no-index.
 
+'git diff' [options]  [[--] [...]]::
+
+   This form is to view the changes you have in your
+   working tree relative to the named .  You can
+   use HEAD to compare it with the latest commit, or a
+   branch name to compare with the tip of a different
+   branch.
+
 'git diff' [options] --cached [] [[--] [...]]::
 
This form is to view the changes you staged for the next
@@ -45,14 +53,6 @@ directories. This behavior can be forced by --no-index.
 is not given, it shows all staged changes.
--staged is a synonym of --cached.
 
-'git diff' [options]  [[--] [...]]::
-
-   This form is to view the changes you have in your
-   working tree relative to the named .  You can
-   use HEAD to compare it with the latest commit, or a
-   branch name to compare with the tip of a different
-   branch.
-
 'git diff' [options]  ::
 
This form is to view the differences between the raw
-- 
1.8.2.1.502.g2d60b5c

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html