git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Implement git-staged, an alias for 'git diff --cached'.
@ 2008-10-28 23:39 David Symonds
  2008-10-28 23:46 ` Jeff King
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: David Symonds @ 2008-10-28 23:39 UTC (permalink / raw)
  To: git, gitster; +Cc: David Symonds

Signed-off-by: David Symonds <dsymonds@gmail.com>
---
  This isn't a particularly serious patch, but is very relevant to our
  current discussion at GitTogether '08.

 .gitignore    |    1 +
 Makefile      |    1 +
 git-staged.sh |    8 ++++++++
 3 files changed, 10 insertions(+), 0 deletions(-)
 create mode 100755 git-staged.sh

diff --git a/.gitignore b/.gitignore
index bbaf9de..9353d19 100644
--- a/.gitignore
+++ b/.gitignore
@@ -118,6 +118,7 @@ git-show
 git-show-branch
 git-show-index
 git-show-ref
+git-staged
 git-stash
 git-status
 git-stripspace
diff --git a/Makefile b/Makefile
index d6f3695..1b23e53 100644
--- a/Makefile
+++ b/Makefile
@@ -262,6 +262,7 @@ SCRIPT_SH += git-rebase.sh
 SCRIPT_SH += git-repack.sh
 SCRIPT_SH += git-request-pull.sh
 SCRIPT_SH += git-sh-setup.sh
+SCRIPT_SH += git-staged.sh
 SCRIPT_SH += git-stash.sh
 SCRIPT_SH += git-submodule.sh
 SCRIPT_SH += git-web--browse.sh
diff --git a/git-staged.sh b/git-staged.sh
new file mode 100755
index 0000000..bfd36e7
--- /dev/null
+++ b/git-staged.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+USAGE=''
+SUBDIRECTORY_OK='Yes'
+OPTIONS_SPEC=
+. git-sh-setup
+
+git diff --cached
-- 
1.6.0

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-28 23:39 [PATCH] Implement git-staged, an alias for 'git diff --cached' David Symonds
@ 2008-10-28 23:46 ` Jeff King
  2008-10-28 23:59 ` David Symonds
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 25+ messages in thread
From: Jeff King @ 2008-10-28 23:46 UTC (permalink / raw)
  To: David Symonds; +Cc: git, gitster

On Tue, Oct 28, 2008 at 04:39:05PM -0700, David Symonds wrote:

> --- /dev/null
> +++ b/git-staged.sh
> @@ -0,0 +1,8 @@
> +#!/bin/sh
> +
> +USAGE=''
> +SUBDIRECTORY_OK='Yes'
> +OPTIONS_SPEC=
> +. git-sh-setup
> +
> +git diff --cached

Do you even need to do sh-setup? How about

  #!/bin/sh
  exec git diff --cached "$@"

-Peff

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

* [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-28 23:39 [PATCH] Implement git-staged, an alias for 'git diff --cached' David Symonds
  2008-10-28 23:46 ` Jeff King
@ 2008-10-28 23:59 ` David Symonds
  2008-10-29  0:39   ` Jeff King
  2008-10-29 14:58 ` Pascal Obry
  2008-10-29 19:49 ` Felipe Contreras
  3 siblings, 1 reply; 25+ messages in thread
From: David Symonds @ 2008-10-28 23:59 UTC (permalink / raw)
  To: git, gitster, Jeff King; +Cc: David Symonds

Signed-off-by: David Symonds <dsymonds@gmail.com>
---
 .gitignore    |    1 +
 Makefile      |    1 +
 git-staged.sh |    2 ++
 3 files changed, 4 insertions(+), 0 deletions(-)
 create mode 100755 git-staged.sh

diff --git a/.gitignore b/.gitignore
index bbaf9de..9353d19 100644
--- a/.gitignore
+++ b/.gitignore
@@ -118,6 +118,7 @@ git-show
 git-show-branch
 git-show-index
 git-show-ref
+git-staged
 git-stash
 git-status
 git-stripspace
diff --git a/Makefile b/Makefile
index d6f3695..1b23e53 100644
--- a/Makefile
+++ b/Makefile
@@ -262,6 +262,7 @@ SCRIPT_SH += git-rebase.sh
 SCRIPT_SH += git-repack.sh
 SCRIPT_SH += git-request-pull.sh
 SCRIPT_SH += git-sh-setup.sh
+SCRIPT_SH += git-staged.sh
 SCRIPT_SH += git-stash.sh
 SCRIPT_SH += git-submodule.sh
 SCRIPT_SH += git-web--browse.sh
diff --git a/git-staged.sh b/git-staged.sh
new file mode 100755
index 0000000..85582ec
--- /dev/null
+++ b/git-staged.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec git diff --cached $*
-- 
1.6.0

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-28 23:59 ` David Symonds
@ 2008-10-29  0:39   ` Jeff King
  2008-10-29  0:44     ` David Symonds
  2008-10-29  1:01     ` Stephan Beyer
  0 siblings, 2 replies; 25+ messages in thread
From: Jeff King @ 2008-10-29  0:39 UTC (permalink / raw)
  To: David Symonds; +Cc: git, gitster

On Tue, Oct 28, 2008 at 04:59:28PM -0700, David Symonds wrote:

> --- /dev/null
> +++ b/git-staged.sh
> @@ -0,0 +1,2 @@
> +#!/bin/sh
> +exec git diff --cached $*

This is broken for arguments with spaces. Use "$@" instead.

But I think this isn't a serious patch anyway, so we are probably
wasting too much time on it. ;P

-Peff

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

* [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-29  0:39   ` Jeff King
@ 2008-10-29  0:44     ` David Symonds
  2008-10-29  1:02       ` Johannes Schindelin
  2008-10-29 10:59       ` Wincent Colaiuta
  2008-10-29  1:01     ` Stephan Beyer
  1 sibling, 2 replies; 25+ messages in thread
From: David Symonds @ 2008-10-29  0:44 UTC (permalink / raw)
  To: git, gitster, Jeff King; +Cc: David Symonds

Signed-off-by: David Symonds <dsymonds@gmail.com>
---
 .gitignore    |    1 +
 Makefile      |    1 +
 git-staged.sh |    2 ++
 3 files changed, 4 insertions(+), 0 deletions(-)
 create mode 100755 git-staged.sh

diff --git a/.gitignore b/.gitignore
index bbaf9de..9353d19 100644
--- a/.gitignore
+++ b/.gitignore
@@ -118,6 +118,7 @@ git-show
 git-show-branch
 git-show-index
 git-show-ref
+git-staged
 git-stash
 git-status
 git-stripspace
diff --git a/Makefile b/Makefile
index d6f3695..1b23e53 100644
--- a/Makefile
+++ b/Makefile
@@ -262,6 +262,7 @@ SCRIPT_SH += git-rebase.sh
 SCRIPT_SH += git-repack.sh
 SCRIPT_SH += git-request-pull.sh
 SCRIPT_SH += git-sh-setup.sh
+SCRIPT_SH += git-staged.sh
 SCRIPT_SH += git-stash.sh
 SCRIPT_SH += git-submodule.sh
 SCRIPT_SH += git-web--browse.sh
diff --git a/git-staged.sh b/git-staged.sh
new file mode 100755
index 0000000..66a5e33
--- /dev/null
+++ b/git-staged.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec git diff --cached "$@"
-- 
1.6.0

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-29  1:02       ` Johannes Schindelin
@ 2008-10-29  0:58         ` Jeff King
  0 siblings, 0 replies; 25+ messages in thread
From: Jeff King @ 2008-10-29  0:58 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: David Symonds, git, gitster

On Wed, Oct 29, 2008 at 02:02:29AM +0100, Johannes Schindelin wrote:

> > +git-staged
> 
> Would it not be better to teach "git show --staged" to do that, and to add 
> a command pair "git stage <file>" and "git unstage <file>" to do the 
> obvious?

Yes, I think half of the discussion went on IRC. But I don't think "git
staged" is a good idea. I think a "--staged" alias for "--cached" in
"git diff" makes a lot more sense.

-Peff

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-29  0:39   ` Jeff King
  2008-10-29  0:44     ` David Symonds
@ 2008-10-29  1:01     ` Stephan Beyer
  2008-10-29  1:05       ` Jeff King
  1 sibling, 1 reply; 25+ messages in thread
From: Stephan Beyer @ 2008-10-29  1:01 UTC (permalink / raw)
  To: Jeff King; +Cc: David Symonds, git, gitster

Hi,

> > --- /dev/null
> > +++ b/git-staged.sh
> > @@ -0,0 +1,2 @@
> > +#!/bin/sh
> > +exec git diff --cached $*
> 
> This is broken for arguments with spaces. Use "$@" instead.
> 
> But I think this isn't a serious patch anyway, so we are probably
> wasting too much time on it. ;P

I'm still not understanding, what it's for.
Usability? Because doing
	git config --global alias.staged 'diff --cached'
is lame?

Regards,
  Stephan

PS: Btw, if ever meant serious, it's missing an insertion into
    command-list.txt and serious documentation.
    But I think you know that. :-)

-- 
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-29  0:44     ` David Symonds
@ 2008-10-29  1:02       ` Johannes Schindelin
  2008-10-29  0:58         ` Jeff King
  2008-10-29 10:59       ` Wincent Colaiuta
  1 sibling, 1 reply; 25+ messages in thread
From: Johannes Schindelin @ 2008-10-29  1:02 UTC (permalink / raw)
  To: David Symonds; +Cc: git, gitster, Jeff King

Hi,

On Tue, 28 Oct 2008, David Symonds wrote:

> diff --git a/.gitignore b/.gitignore
> index bbaf9de..9353d19 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -118,6 +118,7 @@ git-show
>  git-show-branch
>  git-show-index
>  git-show-ref
> +git-staged

Would it not be better to teach "git show --staged" to do that, and to add 
a command pair "git stage <file>" and "git unstage <file>" to do the 
obvious?

Ciao,
Dscho

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-29  1:01     ` Stephan Beyer
@ 2008-10-29  1:05       ` Jeff King
  2008-10-29 14:33         ` Brandon Casey
  0 siblings, 1 reply; 25+ messages in thread
From: Jeff King @ 2008-10-29  1:05 UTC (permalink / raw)
  To: Stephan Beyer; +Cc: David Symonds, git, gitster

On Wed, Oct 29, 2008 at 02:01:07AM +0100, Stephan Beyer wrote:

> I'm still not understanding, what it's for.
> Usability? Because doing
> 	git config --global alias.staged 'diff --cached'
> is lame?

You are missing some of the context, which is that we just had a big
in-person debate about how the staged nomenclature is confusing. We call
things "cached", "staged", and "index", depending on the command.

So this is an attempt to rectify that.

-Peff

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-29  0:44     ` David Symonds
  2008-10-29  1:02       ` Johannes Schindelin
@ 2008-10-29 10:59       ` Wincent Colaiuta
  2008-10-29 15:08         ` Johannes Schindelin
  1 sibling, 1 reply; 25+ messages in thread
From: Wincent Colaiuta @ 2008-10-29 10:59 UTC (permalink / raw)
  To: David Symonds; +Cc: git, gitster, Jeff King

El 29/10/2008, a las 1:44, David Symonds escribió:

> +SCRIPT_SH += git-staged.sh

Isn't this exactly what aliases are for?
   git config --global alias.staged "diff --cached"
(Rather than adding yet another command...)

Wincent

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-29  1:05       ` Jeff King
@ 2008-10-29 14:33         ` Brandon Casey
  2008-10-29 15:19           ` Jeff King
  0 siblings, 1 reply; 25+ messages in thread
From: Brandon Casey @ 2008-10-29 14:33 UTC (permalink / raw)
  To: Jeff King; +Cc: Stephan Beyer, David Symonds, git, gitster

Jeff King wrote:
> On Wed, Oct 29, 2008 at 02:01:07AM +0100, Stephan Beyer wrote:
> 
>> I'm still not understanding, what it's for.
>> Usability? Because doing
>> 	git config --global alias.staged 'diff --cached'
>> is lame?
> 
> You are missing some of the context,

Yeah, it would have been nice if there was audio.
Anyone take minutes, possibly?

btw the term "staged" makes perfect sense to me, whereas "cached"
was not intuitively obvious to me.

-brandon

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-28 23:39 [PATCH] Implement git-staged, an alias for 'git diff --cached' David Symonds
  2008-10-28 23:46 ` Jeff King
  2008-10-28 23:59 ` David Symonds
@ 2008-10-29 14:58 ` Pascal Obry
  2008-10-29 19:49 ` Felipe Contreras
  3 siblings, 0 replies; 25+ messages in thread
From: Pascal Obry @ 2008-10-29 14:58 UTC (permalink / raw)
  To: David Symonds; +Cc: git, gitster

What about :

   $ git config --global alias.staged "diff --cached"

I'm using this since some time.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-29 10:59       ` Wincent Colaiuta
@ 2008-10-29 15:08         ` Johannes Schindelin
  2008-10-29 15:22           ` Stephan Beyer
  2008-10-29 16:16           ` Wincent Colaiuta
  0 siblings, 2 replies; 25+ messages in thread
From: Johannes Schindelin @ 2008-10-29 15:08 UTC (permalink / raw)
  To: Wincent Colaiuta; +Cc: David Symonds, git, gitster, Jeff King

[-- Attachment #1: Type: TEXT/PLAIN, Size: 859 bytes --]

Hi,

On Wed, 29 Oct 2008, Wincent Colaiuta wrote:

> El 29/10/2008, a las 1:44, David Symonds escribió:
> 
> > +SCRIPT_SH += git-staged.sh
> 
> Isn't this exactly what aliases are for?
>   git config --global alias.staged "diff --cached"
> (Rather than adding yet another command...)

The difference being, of course, that we do not ship default aliases (and 
neither do we plan to...).

So saying "this is what aliases are for" you ask for _newbies_ to add it 
for themselves.  We are talking the same newbies who should be helped by 
that command, and typically do not know that there are Git aliases yet.

Even worse, just sum the times it takes everybody to make that alias, and 
then compare with the time it would take to include something like David 
posted in git.git.  It should be obvious that the time balance is 
absolutely horrible.

Ciao,
Dscho

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-29 14:33         ` Brandon Casey
@ 2008-10-29 15:19           ` Jeff King
  0 siblings, 0 replies; 25+ messages in thread
From: Jeff King @ 2008-10-29 15:19 UTC (permalink / raw)
  To: Brandon Casey; +Cc: Stephan Beyer, David Symonds, git, gitster

On Wed, Oct 29, 2008 at 09:33:08AM -0500, Brandon Casey wrote:

> > You are missing some of the context,
> 
> Yeah, it would have been nice if there was audio.
> Anyone take minutes, possibly?

There's no audio. Some of the slides will be available. I took notes on
at least one of the discussions, which I will try to summarize and post.
And I think some of the discussion will end up as patches, which will
hopefully provide full justification in their commit messages. ;)

-Peff

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-29 15:08         ` Johannes Schindelin
@ 2008-10-29 15:22           ` Stephan Beyer
  2008-10-29 15:48             ` Johannes Schindelin
  2008-10-29 16:16           ` Wincent Colaiuta
  1 sibling, 1 reply; 25+ messages in thread
From: Stephan Beyer @ 2008-10-29 15:22 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Wincent Colaiuta, David Symonds, git, gitster, Jeff King

Hi,

Johannes Schindelin wrote:
> So saying "this is what aliases are for" you ask for _newbies_ to add it 
> for themselves.  We are talking the same newbies who should be helped by 
> that command, and typically do not know that there are Git aliases yet.

I'm not sure if yet more commands really help newbies.

I *see* the problem that talking about the index, the cache and the staging
area can be difficult to newbies.  But then I'd rather vote for "git diff
--staged" (instead of --cached) or "git show --staged" (both make sense
in some way).
Perhaps it is even sufficient to add a help text to "git status", like
this:

 # Changes to be committed:
 #   (use "git reset HEAD <file>..." to unstage)
+#   (use "git diff --cached" to see a diff of staged files)

For me, a "git staged" feels wrong without a "git stage" (alias for
"git add") and "git unstage <file>" (alias for "git reset <file>").
And I think the list of examples can easily be continued.

Regards,
  Stephan

-- 
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-29 15:22           ` Stephan Beyer
@ 2008-10-29 15:48             ` Johannes Schindelin
  0 siblings, 0 replies; 25+ messages in thread
From: Johannes Schindelin @ 2008-10-29 15:48 UTC (permalink / raw)
  To: Stephan Beyer; +Cc: Wincent Colaiuta, David Symonds, git, gitster, Jeff King

Hi,

On Wed, 29 Oct 2008, Stephan Beyer wrote:

> For me, a "git staged" feels wrong without a "git stage" (alias for "git 
> add") and "git unstage <file>" (alias for "git reset <file>"). And I 
> think the list of examples can easily be continued.

http://article.gmane.org/gmane.comp.version-control.git/99340

Thanks,
Dscho

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-29 15:08         ` Johannes Schindelin
  2008-10-29 15:22           ` Stephan Beyer
@ 2008-10-29 16:16           ` Wincent Colaiuta
  2008-10-29 17:03             ` Johannes Schindelin
  1 sibling, 1 reply; 25+ messages in thread
From: Wincent Colaiuta @ 2008-10-29 16:16 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: David Symonds, git, gitster, Jeff King

El 29/10/2008, a las 16:08, Johannes Schindelin escribió:

> Hi,
>
> On Wed, 29 Oct 2008, Wincent Colaiuta wrote:
>
>> El 29/10/2008, a las 1:44, David Symonds escribió:
>>
>>> +SCRIPT_SH += git-staged.sh
>>
>> Isn't this exactly what aliases are for?
>>  git config --global alias.staged "diff --cached"
>> (Rather than adding yet another command...)
>
> The difference being, of course, that we do not ship default aliases  
> (and
> neither do we plan to...).
>
> So saying "this is what aliases are for" you ask for _newbies_ to  
> add it
> for themselves.  We are talking the same newbies who should be  
> helped by
> that command, and typically do not know that there are Git aliases  
> yet.
>
> Even worse, just sum the times it takes everybody to make that  
> alias, and
> then compare with the time it would take to include something like  
> David
> posted in git.git.  It should be obvious that the time balance is
> absolutely horrible.

Git already has too many commands. Adding more is not going to clear  
up newbie confusion, and will only waste time because people will  
complain about it and ask why there is this kind of duplication.

W

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-29 16:16           ` Wincent Colaiuta
@ 2008-10-29 17:03             ` Johannes Schindelin
  2008-10-29 17:13               ` Pascal Obry
  2008-10-29 17:42               ` Wincent Colaiuta
  0 siblings, 2 replies; 25+ messages in thread
From: Johannes Schindelin @ 2008-10-29 17:03 UTC (permalink / raw)
  To: Wincent Colaiuta; +Cc: David Symonds, git, gitster, Jeff King

Hi,

On Wed, 29 Oct 2008, Wincent Colaiuta wrote:

> Git already has too many commands. Adding more is not going to clear up 
> newbie confusion, and will only waste time because people will complain 
> about it and ask why there is this kind of duplication.

I completely disagree.  If the existing set of commands causes confusion, 
we need to deprecate those parts and add new commands.  Even if we have a 
ton of commands already.

It does not need to hurt, either.  Just think of init-db.  Ever heard of 
it?  We still have it, yet it is not relevant.

Ciao,
Dscho

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-29 17:03             ` Johannes Schindelin
@ 2008-10-29 17:13               ` Pascal Obry
  2008-10-29 17:42               ` Wincent Colaiuta
  1 sibling, 0 replies; 25+ messages in thread
From: Pascal Obry @ 2008-10-29 17:13 UTC (permalink / raw)
  To: Johannes Schindelin
  Cc: Wincent Colaiuta, David Symonds, git, gitster, Jeff King

Johannes Schindelin a écrit :
> I completely disagree.  If the existing set of commands causes confusion, 
> we need to deprecate those parts and add new commands.  Even if we have a 
> ton of commands already.
> 
> It does not need to hurt, either.  Just think of init-db.  Ever heard of 
> it?  We still have it, yet it is not relevant.

In this specific case adding a new command as an alias for a
command+option seems wrong! I much prefer adding the alias --staged for
--cached - as proposed now - if it can make things easier for new comers.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-29 17:03             ` Johannes Schindelin
  2008-10-29 17:13               ` Pascal Obry
@ 2008-10-29 17:42               ` Wincent Colaiuta
  2008-10-29 18:30                 ` Teemu Likonen
  2008-10-29 19:23                 ` Johannes Schindelin
  1 sibling, 2 replies; 25+ messages in thread
From: Wincent Colaiuta @ 2008-10-29 17:42 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: David Symonds, git, gitster, Jeff King

El 29/10/2008, a las 18:03, Johannes Schindelin escribió:

> Hi,
>
> On Wed, 29 Oct 2008, Wincent Colaiuta wrote:
>
>> Git already has too many commands. Adding more is not going to  
>> clear up
>> newbie confusion, and will only waste time because people will  
>> complain
>> about it and ask why there is this kind of duplication.
>
> I completely disagree.  If the existing set of commands causes  
> confusion,
> we need to deprecate those parts and add new commands.  Even if we  
> have a
> ton of commands already.

The confusion isn't at the command level; it's at the switch/option  
level. The solution isn't to add a new command.

> It does not need to hurt, either.  Just think of init-db.  Ever  
> heard of
> it?  We still have it, yet it is not relevant.

The comparison isn't really valid. init-db is effectively invisible,  
but you're talking about adding a new "in your face" porcelain command.

W

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-29 17:42               ` Wincent Colaiuta
@ 2008-10-29 18:30                 ` Teemu Likonen
  2008-10-29 20:24                   ` David Kågedal
  2008-10-29 19:23                 ` Johannes Schindelin
  1 sibling, 1 reply; 25+ messages in thread
From: Teemu Likonen @ 2008-10-29 18:30 UTC (permalink / raw)
  To: Wincent Colaiuta
  Cc: Johannes Schindelin, David Symonds, git, gitster, Jeff King

Wincent Colaiuta (2008-10-29 18:42 +0100) wrote:

> El 29/10/2008, a las 18:03, Johannes Schindelin escribió:
>> I completely disagree. If the existing set of commands causes
>> confusion, we need to deprecate those parts and add new commands.
>> Even if we have a ton of commands already.
>
> The confusion isn't at the command level; it's at the switch/option
> level. The solution isn't to add a new command.

I don't remember being confused in particular area but I think it's a
_very_ good thing that the following three are behind the same "diff"
command:

    git diff
    git diff --cached       (or --staged)
    git diff HEAD

It's also good idea to pretty much always teach those three together.

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-29 17:42               ` Wincent Colaiuta
  2008-10-29 18:30                 ` Teemu Likonen
@ 2008-10-29 19:23                 ` Johannes Schindelin
  2008-10-29 19:44                   ` Wincent Colaiuta
  1 sibling, 1 reply; 25+ messages in thread
From: Johannes Schindelin @ 2008-10-29 19:23 UTC (permalink / raw)
  To: Wincent Colaiuta; +Cc: David Symonds, git, gitster, Jeff King

[-- Attachment #1: Type: TEXT/PLAIN, Size: 799 bytes --]

Hi,

On Wed, 29 Oct 2008, Wincent Colaiuta wrote:

> El 29/10/2008, a las 18:03, Johannes Schindelin escribió:
> 
> >On Wed, 29 Oct 2008, Wincent Colaiuta wrote:
> >
> > >Git already has too many commands. Adding more is not going to clear 
> > >up newbie confusion, and will only waste time because people will 
> > >complain about it and ask why there is this kind of duplication.
> >
> >I completely disagree.  If the existing set of commands causes 
> >confusion, we need to deprecate those parts and add new commands.  
> >Even if we have a ton of commands already.
> 
> The confusion isn't at the command level; it's at the switch/option 
> level. The solution isn't to add a new command.

Seems that at leat one guy who does Git training disagrees with you, _in 
addition_ to me.

Ciao,
Dscho

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-29 19:23                 ` Johannes Schindelin
@ 2008-10-29 19:44                   ` Wincent Colaiuta
  0 siblings, 0 replies; 25+ messages in thread
From: Wincent Colaiuta @ 2008-10-29 19:44 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: David Symonds, git, gitster, Jeff King

El 29/10/2008, a las 20:23, Johannes Schindelin escribió:

> Hi,
>
> On Wed, 29 Oct 2008, Wincent Colaiuta wrote:
>
>> El 29/10/2008, a las 18:03, Johannes Schindelin escribió:
>>
>>> On Wed, 29 Oct 2008, Wincent Colaiuta wrote:
>>>
>>>> Git already has too many commands. Adding more is not going to  
>>>> clear
>>>> up newbie confusion, and will only waste time because people will
>>>> complain about it and ask why there is this kind of duplication.
>>>
>>> I completely disagree.  If the existing set of commands causes
>>> confusion, we need to deprecate those parts and add new commands.
>>> Even if we have a ton of commands already.
>>
>> The confusion isn't at the command level; it's at the switch/option
>> level. The solution isn't to add a new command.
>
> Seems that at leat one guy who does Git training disagrees with you,  
> _in
> addition_ to me.

That's what I call a "zero value" addition to the thread, seeing as  
anyone reading the thread _already_ knows the opinions of the  
participants who've posted.

Adding a separate command to an already overwhelming command set in  
order to address confusion about options to "git diff" is a case of  
"duct-tape UI design".

Wincent

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-28 23:39 [PATCH] Implement git-staged, an alias for 'git diff --cached' David Symonds
                   ` (2 preceding siblings ...)
  2008-10-29 14:58 ` Pascal Obry
@ 2008-10-29 19:49 ` Felipe Contreras
  3 siblings, 0 replies; 25+ messages in thread
From: Felipe Contreras @ 2008-10-29 19:49 UTC (permalink / raw)
  To: David Symonds; +Cc: git, gitster

On Wed, Oct 29, 2008 at 1:39 AM, David Symonds <dsymonds@gmail.com> wrote:
> Signed-off-by: David Symonds <dsymonds@gmail.com>
> ---
>  This isn't a particularly serious patch, but is very relevant to our
>  current discussion at GitTogether '08.

I've thought about some commands like:
git stage $file (git add $file)
git unstage $file (git reset $file)

Perhaps
git stage add
git stage rm

And then your proposal would fit with:
git stage diff

Or something like that.

-- 
Felipe Contreras

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

* Re: [PATCH] Implement git-staged, an alias for 'git diff --cached'.
  2008-10-29 18:30                 ` Teemu Likonen
@ 2008-10-29 20:24                   ` David Kågedal
  0 siblings, 0 replies; 25+ messages in thread
From: David Kågedal @ 2008-10-29 20:24 UTC (permalink / raw)
  To: git
  Cc: Teemu Likonen, Wincent Colaiuta, Johannes Schindelin,
	David Symonds, gitster, Jeff King

Teemu Likonen <tlikonen@iki.fi> writes:

> Wincent Colaiuta (2008-10-29 18:42 +0100) wrote:
>
>> El 29/10/2008, a las 18:03, Johannes Schindelin escribió:
>>> I completely disagree. If the existing set of commands causes
>>> confusion, we need to deprecate those parts and add new commands.
>>> Even if we have a ton of commands already.
>>
>> The confusion isn't at the command level; it's at the switch/option
>> level. The solution isn't to add a new command.
>
> I don't remember being confused in particular area but I think it's a
> _very_ good thing that the following three are behind the same "diff"
> command:
>
>     git diff
>     git diff --cached       (or --staged)
>     git diff HEAD

One irregularity hear is that there is no way to explicitly say what
you want to compare against the index (the staging area).  Diff
compares two things to each other, and a more regular and general way
to express what it does would be something like

    git diff STAGE WORKTREE   (like "git diff" today)
    git diff HEAD WORKTREE    (like "git diff HEAD" today)
    git diff WORKTREE HEAD    (like "git diff -R HEAD" today)
    git diff HEAD STAGE       (like "git diff --cached" today)
    git diff commit STAGE     (like "git diff --cached commit" today)

To me, it isn't obvious that --cached changes the thing you *compare*
rather than the thing you compare *against*.  I think it would be
useful to have a way of explicitly stating what you compare, something
like what I wrote above, and then having useful shortcuts for common
cases (like that no arguments compares the work tree against the
stage).

-- 
David Kågedal

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

end of thread, other threads:[~2008-10-29 20:26 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-28 23:39 [PATCH] Implement git-staged, an alias for 'git diff --cached' David Symonds
2008-10-28 23:46 ` Jeff King
2008-10-28 23:59 ` David Symonds
2008-10-29  0:39   ` Jeff King
2008-10-29  0:44     ` David Symonds
2008-10-29  1:02       ` Johannes Schindelin
2008-10-29  0:58         ` Jeff King
2008-10-29 10:59       ` Wincent Colaiuta
2008-10-29 15:08         ` Johannes Schindelin
2008-10-29 15:22           ` Stephan Beyer
2008-10-29 15:48             ` Johannes Schindelin
2008-10-29 16:16           ` Wincent Colaiuta
2008-10-29 17:03             ` Johannes Schindelin
2008-10-29 17:13               ` Pascal Obry
2008-10-29 17:42               ` Wincent Colaiuta
2008-10-29 18:30                 ` Teemu Likonen
2008-10-29 20:24                   ` David Kågedal
2008-10-29 19:23                 ` Johannes Schindelin
2008-10-29 19:44                   ` Wincent Colaiuta
2008-10-29  1:01     ` Stephan Beyer
2008-10-29  1:05       ` Jeff King
2008-10-29 14:33         ` Brandon Casey
2008-10-29 15:19           ` Jeff King
2008-10-29 14:58 ` Pascal Obry
2008-10-29 19:49 ` Felipe Contreras

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).