git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jerome Lovy <t2a2e9z8ncbs9qg@brefemail.com>
To: git@vger.kernel.org
Subject: [RFC] A unique way to express "all" (vs "add vs "update") ?
Date: Fri, 15 Dec 2006 12:38:51 +0100	[thread overview]
Message-ID: <elu1cn$k3$1@sea.gmane.org> (raw)

Hi,

While I am very happy with the refactorings undertaken with regard to
"git add/git commit" (both for UI and documentation), I am still a
little confused by the different ways I seem to find to express the idea
"I want to add (sort of) all file contents".

To be more specific, I find the following in the current documentation:

git add <dir>
	"adds content from all files under <dir>  directory and its
	subdirectories."
	(as interpreted from the "EXAMPLES" section of the git-add
	man-page)
	(BTW, could this <dir> usage be documented in the SYNOPSIS and
	DESCRIPTION sections (admittedly at a 2nd rank after the
	currently documented usage)  as well as in the EXAMPLES ?
	Besides this reference sections would probably include the
	<dir>/<regexp> usage that I've not mentioned here for the sake
	of simplicity.)
	
	Moreover, the tutorial documents the typical usage "git add ."

git commit -a|--all
	"automatically stage files that have been modified and deleted,
	but new files you have not told git about are not affected."

Granted, the latter semantics for "all" is not exactly the same as the
former. Nonetheless, I think it would be very nice to only have to 
memorize one way to express "all".

To this end, I would be very happy with the following:
(X-mas is coming soon, isn't it ;-)  )

git add <dir>
	same semantics

git commit -a|--add <files>
	"adds content from the specified files before committing
	(files that are already tracked have their current content
	staged)"

git commit -a|--add <dir>
	"adds content from all files under <dir>  directory and its
	subdirectories before committing"
	(once again, for simplification of my explanations, I omit the
	<dir>/<regexp> usage here)

git commit -u|--update <dir>
	"automatically stage files that have been modified and deleted
	under <dir>  directory and its subdirectories, but new files you
	have not told git about are not affected."
	(once again, for simplification of my explanations, I omit the
	<dir>/<regexp> usage here)

	(This would allow the typical usage "git commit -u ." which is
	barely longer than the current "git commit -a")

For interface completeness, "git commit -u|--update <files>" could also
exist but would probably be of no use.

To sum up, "all" would be consistently expressed with the <dir> syntax.
"git commit -a" would not mean "--all" anymore. Lastly, a distinction
would be made between "--add" and "--update":
- "git commit -add" would have the same semantics as "git add"
- "git commit --update" on the other hand would only affect the files
   already tracked

Thank you for your patient attention.
Jérôme Lovy

             reply	other threads:[~2006-12-15 11:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-15 11:38 Jerome Lovy [this message]
2006-12-15 12:09 ` [RFC] A unique way to express "all" (vs "add vs "update") ? Andreas Ericsson
2006-12-15 21:55   ` Junio C Hamano
2006-12-18 11:48   ` Jerome Lovy
2006-12-15 23:07 ` Carl Worth
2006-12-18 14:04   ` Jerome Lovy

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='elu1cn$k3$1@sea.gmane.org' \
    --to=t2a2e9z8ncbs9qg@brefemail.com \
    --cc=git@vger.kernel.org \
    /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).