From: Jeff King <peff@peff.net>
To: Sam Vilain <samv@vilain.net>
Cc: git@vger.kernel.org,
Johannes Schindelin <johannes.schindelin@gmx.de>,
Scott Chacon <schacon@gmail.com>,
Tom Preston-Werner <tom@github.com>,
"J.H." <warthog19@eaglescrag.net>,
Christian Couder <chriscool@tuxfamily.org>,
Kai Blin <kai@samba.org>
Subject: Re: [PATCH] Documentation: add a planning document for the next CLI revamp
Date: Thu, 30 Oct 2008 20:31:54 -0400 [thread overview]
Message-ID: <20081031003154.GA5745@sigill.intra.peff.net> (raw)
In-Reply-To: <20081030002239.D453B21D14E@mail.utsl.gen.nz>
On Wed, Oct 29, 2008 at 05:22:00PM -0700, Sam Vilain wrote:
> Some suggestions, which have been briefly scanned over by some of the
> (remaining) GitTogether attendees. Please keep it constructive! :)
Thanks for putting this together.
> + * 'git stage' would do what 'git add' does now.
> +
> + * 'git unstage' would do what 'git reset --' does now
These seem reasonable.
> + * 'git status' would encourage the user to use
> + 'git diff --staged' to see staged changes as a patch
I notice the commit template message getting longer and longer. Maybe it
is time for status.verbosetemplate (which could default to true, I just
want to be able to turn it off).
> + * 'git commit' with no changes should give useful information about
> + using 'git stage', 'git commit -a' or 'git commit filename ...'
There is already infrastructure that figures out exactly what the
situation is (no changes versus changes in untracked files versus
changes in unstaged files), so it should just be a matter of tweaking
the messages.
> + * 'git add' and 'git rm': no change
> +
> + * 'git update-index' considered plumbing, not changed
Definitely.
> + * 'git revert' deprecated in favour of 'git cherry-pick --revert'
I think I would make it "-R, --reverse", since it really is analagous to
"git diff -R".
> + * 'git undo' would do what 'git checkout HEAD --' does now
This is an awful name, IMHO. It doesn't point out _what_ you're undoing,
so it leaves me with the feeling that you can undo arbitrary things.
I think the name needs to be considered along with related operations.
So think of us as having three "spots": the HEAD (H), the "stage"[1] (S),
and the working tree (W). And we want commands for moving content
between them. Now we have:
W->S: add
H->S: reset --
S->W: checkout --
S->H: commit (no paths)
And if you want to include things that jump the staging area:
W->H: commit (paths or -a)
H->W: checkout HEAD --
So I think with your stage/unstage, we have:
W->S: stage
H->S: unstage
S->W: ?
S->H: commit (no paths)
W->H: commit (paths or -a)
H->W: ?
So I think we can note something: movement commands are related based on
their _destination_. So since both of the missing ones impact the
working tree, they should have a related name.
But do note the difference between "stage vs unstage" as opposed to
"commit versus commit -a". I think this is because the stage sits in the
middle. So it is mentally "which direction are changes coming from" and
not "how _far_ are changes coming from".
So by that rationale, we should have a single command which says "put
stuff in the working tree", with a flag for "from HEAD" versus "from the
staging area." And that's what we have right now with "git checkout".
The real problem with it is that it is an overload of checkout's other
behavior of switching branches.
So what I am saying is "git undo" _must_ support both "put index content
into working tree" as well as "put HEAD content into working tree", or
it will be a step backwards in consistency.
So I guess that doesn't really suggest a name. But "undo" is awful. ;P
Side note: there are actually _other_ places you might want to move
content. Like a stash. So now you can think of it as:
stash
^ ^
/ \
/ \
v v
HEAD <--> stage <--> working tree
So maybe we just need a "git content" command. And then you can "git
content --from=HEAD --to=tree <paths>" or "git content --from=tree
--to=stash", with all equally supporting "--interactive". And of course
I am kidding, because typing that would be awful. But I think
conceptually, it makes sense. To me, anyway.
> + * 'git branch --switch' : alternative to checkout
Blech. I think switching branches is the one thing that checkout does
unconfusedly. And this is much more typing. Not to mention that So I
would rather see "git switch" if checkout is somehow unpalatable.
But I don't know that it is. This seems like an attempt to say "branch
operations should all be part of 'git branch'". But checkout isn't
necessarily a branch operation. Consider detaching HEAD to a tag. Should
it be "git tag --switch"?
> + * 'git push --matching' does what 'git push' does today (without
> + explicit configuration)
I think this is reasonable even without other changes, just to override
any configuration.
> + * 'git push' with no ref args and no 'push =' configuration does
> + what:
> + 'git push origin $(git symbolic-ref HEAD | sed "s!refs/heads/!!")'
> + does today. ie, it only pushes the current branch.
> + If a branch was defined in branch.<name>.push, push to that ref
> + instead of the matching one. If there is no matching ref, and
> + there is a branch.<name>.merge, push back there.
There was a thread between me and Junio some months ago that touched on
this. I don't remember all of the arguments, but it was resolved to keep
the current behavior. Any proposal along these lines should at least
revisit and respond to those arguments.
> + * 'git push' to checked out branch of non-bare repository not
> + allowed without special configuration. Configuration available
I have this patch done and sitting in my repo, but I need to add the
"without special configuration" bit and add tests and docs.
> +Informational
> +-------------
> +
> + * 'git branch' should default to '--color=auto -v'
This should at least be configurable (even if it defaults to "on"). "-v"
is more expensive, and not always wanted.
I, for one, just use "git branch" to get the current branch. I don't
know of a more obvious way to ask for it (and please don't mention an
ever-changing bash prompt).
> + * 'git tag -l' should show more information
I remember somebody talking about this, but not the details. Which
information?
> + * 'git am -3' the default; with global option to make it not the
> + default for those that prefer the speed of -2
I would prefer that personally. I think Linus has been very reasonable
in the past about recognizing that his workflow and speed requirements
aren't always typical, and being willing to accept setting a
configuration flag in those cases. So I think if he ack'd such a patch,
nobody else would complain.
> + * 'git export' command that does what
> + 'git archive --format=tar --prefix=dir | tar x' does now
I agree, if you mean "does what ... does now" means "looks to the user
like ... is happening". This is much more sanely done using
git-checkout-index (though somebody suggested "remote export", which
would need to use tar itself).
> + * 'git init --server' (or similar) should do everything required for
> + exporting::
> +----
> +chmod -R a+rX
> +touch git-daemon-export-ok
> +git gc
> +git update-server-info
> +chmod u+x .git/hooks/post-update
> +git config core.sharedrepository=1
> +----
But not all of those things are necessarily related, and some of them
have security implications. I would hate to get a bug report like "I
used --server because I wanted to share my content via dumb http, but my
repo was p0wned because of too-loose group permissions."
-Peff
next parent reply other threads:[~2008-10-31 0:33 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20081030002239.D453B21D14E@mail.utsl.gen.nz>
2008-10-31 0:31 ` Jeff King [this message]
2008-10-31 6:40 ` [PATCH] Documentation: add a planning document for the next CLI revamp Sam Vilain
2008-10-31 8:20 ` Pierre Habouzit
2008-11-02 4:18 ` Jeff King
2008-11-02 9:56 ` Theodore Tso
2008-10-31 16:46 ` Johannes Schindelin
2008-11-02 3:42 ` Jeff King
2008-11-02 3:53 ` Jeff King
2008-11-02 22:27 ` Junio C Hamano
2008-11-03 5:59 ` Sam Vilain
2008-11-03 9:48 ` Jakub Narebski
2008-11-03 9:53 ` Sverre Rabbelier
2008-11-04 9:18 ` Dmitry Potapov
2008-11-04 18:10 ` Sam Vilain
2008-11-04 19:46 ` Junio C Hamano
2008-11-05 3:05 ` Jeff King
2008-11-05 6:40 ` Junio C Hamano
2008-11-05 22:53 ` Dmitry Potapov
2008-11-03 6:56 ` Jeff King
2008-11-03 6:59 ` Jeff King
2008-11-03 9:25 ` Pierre Habouzit
2008-11-03 23:33 ` Junio C Hamano
2008-11-04 0:02 ` Pierre Habouzit
2008-11-04 0:44 ` Junio C Hamano
2008-11-04 5:20 ` Jeff King
2008-10-30 3:48 Sam Vilain
2008-10-30 10:55 ` Stefan Karpinski
2008-10-31 11:38 ` Kyle Moffett
2008-10-30 13:24 ` Pierre Habouzit
2008-10-30 15:25 ` Julian Phillips
2008-10-31 0:34 ` Jeff King
2008-11-02 21:53 ` Junio C Hamano
2008-11-03 13:47 ` Pierre Habouzit
2008-10-30 14:34 ` Nicolas Pitre
2008-10-30 14:52 ` Shawn O. Pearce
2008-10-30 14:59 ` Mike Hommey
2008-10-30 15:01 ` Pierre Habouzit
2008-10-30 16:53 ` Nicolas Pitre
2008-10-30 17:31 ` Sam Vilain
2008-10-30 18:28 ` Nicolas Pitre
2008-10-30 22:46 ` Yann Dirson
2008-10-30 23:28 ` Sam Vilain
2008-10-30 23:55 ` Jakub Narebski
2008-10-31 6:51 ` Sam Vilain
2008-10-31 7:36 ` Jakub Narebski
2008-11-03 8:43 ` Sam Vilain
2008-11-03 12:06 ` Jakub Narebski
2008-11-01 0:37 ` Johannes Schindelin
2008-10-30 14:39 ` Theodore Tso
2008-10-30 14:43 ` Pierre Habouzit
2008-10-30 16:30 ` Theodore Tso
2008-10-30 16:43 ` Pierre Habouzit
2008-10-30 17:44 ` Sam Vilain
2008-10-30 17:03 ` Nicolas Pitre
2008-11-02 6:08 ` Junio C Hamano
2008-11-02 10:09 ` Theodore Tso
2008-10-30 15:02 ` Andreas Ericsson
2008-11-01 19:57 ` Elijah Newren
2008-10-30 15:20 ` Matthieu Moy
2008-10-30 17:00 ` Nicolas Pitre
2008-10-30 17:03 ` Pierre Habouzit
2008-10-30 17:17 ` Nicolas Pitre
2008-10-30 18:06 ` Sam Vilain
2008-11-02 22:17 ` Junio C Hamano
2008-11-03 6:01 ` Sam Vilain
2008-11-01 19:42 ` Elijah Newren
2008-10-30 17:51 ` Sam Vilain
2008-10-30 23:27 ` Theodore Tso
2008-11-01 20:27 ` Elijah Newren
2008-11-02 1:06 ` Theodore Tso
2008-11-02 4:41 ` Elijah Newren
2008-11-01 19:26 ` Elijah Newren
2008-11-02 22:01 ` Junio C Hamano
2008-11-01 18:36 ` Elijah Newren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081031003154.GA5745@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=johannes.schindelin@gmx.de \
--cc=kai@samba.org \
--cc=samv@vilain.net \
--cc=schacon@gmail.com \
--cc=tom@github.com \
--cc=warthog19@eaglescrag.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).