On Sat, 02 Dec 2006 00:09:09 -0800, Junio C Hamano wrote:I agree. Being too clever is a problem. It's very helpful to estimate usability and learnability by the length of prose needed to describe a command. Junio, thanks so much for these descriptions. They help ground the discussion quite nicely, (and will also contribute to improved documentation). Here's pseudo-code for the above descriptions: if (command-line has paths) { ignore staging area, commit named files else { if (commit -a) update all files into staging area commit staging area } One problem I see in that is that the primary distinction is made based on what appears on the command-line, rather than what job the user is trying to perform. Also, "commit -a" is define in terms of the staging area, even though the staging area is basically irrelevant to this operation, (just as it is in the case of a commit with paths). So I would re-factor that in a way that focuses on what the user is trying to do: if (! doing a staged commit) { if (file list is empty) file list = all tracked files commit file list } else { commit staging area } This brings the description of "commit -a" and "commit files..." together, (which I think are conceptually more related than "commit -a" is to a commit of the staging area, (and yes, this ignores the history of the implementation). What we're talking about is how to document what the user wants to do, not how the implementation does it. Notice also that "staging area" never appears in the description of the else clause, (which is good since the conceptual use of these commands does not involve staging). So translating my re-factored version back into prose, we might get: commit <paths> commit -a Commit the working-tree contents of the named <paths>, (or all tracked paths for -a). Files which no longer exist in the working tree will be removed. New files to be tracked must be added with "git add". commit Commit the content that exists in the staging area. The staging area initially consists of the contents of the most recent commit, but can be modified with the "git add", "git rm", and "git mv". So that's shorter. I think it's also more clear and focused on what the user wants to do without being any less accurate. It doesn't make it obvious that "commit -a" is the most common form and what users should look at first. So what I'd like to see is the semantic changes that would allow us to document this as: commit commit <paths> Commit the working-tree contents of all tracked paths, (or just the specific paths listed). Files which no longer exist in the working tree will be removed. New files to be tracked must be added with "git add". commit --staged Commit the content that exists in the staging area. The staging area initially consists of the contents of the most recent commit, but updated content from the working tree can be placed into it with "git stage <paths>". -Carl
| Oren Laadan | [RFC v2][PATCH 1/9] kernel based checkpoint-restart |
| Luiz Fernando N. Capitulino | 2.6.{26.2,27-rc} oops on virtualbox |
| Tomasz Kłoczko | Is it time for remove (crap) ALSA from kernel tree ? |
| Linus Torvalds | Linux 2.6.27-rc8 |
git: | |
| Linus Torvalds | Re: cleaner/better zlib sources? |
| Jon Smirl | Re: [PATCH] RFC: git lazy clone proof-of-concept |
| Jan-Benedict Glaw | Re: parsecvs tool now creates git repositories |
| Matthieu Moy | git push to a non-bare repository |
| James Hartley | scp batch mode? |
| Alexey Suslikov | OT: OpenBSD on Asus eeePC |
| Karel Kulhavy | lookup option in /etc/resolv.conf ignored |
| Kevin Neff | Patching a SSH 'Weakness' |
| Volker Armin Hemmann | build error with 2.6.27.6+reiser4+ehci-hub patch. ERROR: "mii_ethtool_gset" [drive... |
| Denys Fedoryshchenko | RESEND, HTB(?) softlockup, vanilla 2.6.24 |
| Corey Hickey | [PATCH 05/10] Add divisor. |
| Scott Wood | [PATCH 1/9] fs_enet: Whitespace cleanup. |
| Why does uClinux 2.6.18 bootup block SuperIO UART IRQs that BIOS configured | 32 minutes ago | Linux kernel |
| USB statistics | 2 hours ago | Linux kernel |
| Block Sub System query | 6 hours ago | Linux kernel |
| kernel module to intercept socket creation | 7 hours ago | Linux kernel |
| Image size changing during each build | 7 hours ago | Linux kernel |
| Soft lock bug | 12 hours ago | Linux kernel |
| sysctl - dynamic registration problem | 18 hours ago | Linux kernel |
| Question on swap as ramdisk partition | 21 hours ago | Linux kernel |
| serial driver xmit problem | 1 day ago | Linux kernel |
| Generic Netlink subsytem | 1 day ago | Linux kernel |
