Nicolas Pitre <nico@cam.org> writes:I agree; it was tongue-in-cheek sort of suggestion ;-) Good thinking. I was not thinking about the case where you explicitly list an untracked file to be added. If I may correct what I said earlier, I now realize the "automatic -a is dangerous" argument does not have anything to do with merges. If the user usually works with a dirty working tree, is aware of the index, and takes advantage of the index as the staging area for the next commit, your --no-auto would be needed to help her workflow. I in principle agree with the first three items in the above summary, except that I think it would make more sense to do that for all commits. How about this: - "git commit --also fileA..." means: update index at listed paths (add/remove if necessary) and then commit the tree described in index (the current behaviour with explicit paths). - "git commit fileA..." means: create a temporary index from the current HEAD commit (or empty index if there is none), update it at listed paths (add/remove if necessary) and commit the resulting tree. Also update the real index at the listed paths (add/remove if necessary). In the original index file, the paths listed must be either empty or match exactly the HEAD commit -- otherwise we error out (Linus' suggestion). - "git commit" means: update index with all local changes and then commit the tree described in index (current "-a" behaviour). - In all cases, revert the index to the state before the command is run if we end up not making the commit (e.g. index unmerged, empty log message, pre-commit hook refusal). Experienced git users would end up saying "--also" without explicit paths to defeat the automatic -a behaviour all the time, and while the flag --also makes perfect sense when used with one or more paths, using it like this look awkward: $ edit some-file $ git update-index some-file $ git commit --also It's just a flag name so we could make --no-auto synonym to --also. A minor twist of the above to make it friendlier to the current git users is to do this: - "git commit fileA...", "git commit -a", and "git commit" keep the existing semantics. - "git commit --only fileA..." does the new temporary index thing. This has an advantage that existing use is not affected, and another advantage is that internally it is more consistent ("git commit" is a natural extension of "git commit fileA..." with zero path). But one possible downside is that you need to explicitly say --only when you want cvs-like "commit". Since we are discussing that the people find existing interface to be unintuitive, being consistent with the current usage may not count as a big advantage after all.. - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Rafael J. Wysocki | 2.6.28-rc5: Reported regressions from 2.6.27 |
| Kamalesh Babulal | [BUG] 2.6.23-rc3-mm1 - kernel BUG at net/core/skbuff.c:95! |
| Andi Kleen | Re: [git pull] kgdb-light -v8, (was: Re: kgdb in git-x86#mm review) |
| Karl Meyer | PROBLEM: 2.6.23-rc "NETDEV WATCHDOG: eth0: transmit timed out" |
git: | |
| Mirko Stocker | Working with Git and CVS in a team. |
| Junio C Hamano | Re: [PATCH] Teach remote machinery about remotes.default config variable |
| Wink Saville | Resolving conflicts |
| Sam Song | Fwd: [OT] Re: Git via a proxy server? |
| Jerome Santos | sshd.config and AllowUsers |
| Marco Peereboom | Re: What is our ultimate goal?? |
| Will Maier | Re: howto set global environment variable (e.g. PATH, JAVA_HOME) |
| Brandon Lee | DELL PERC 5iR slow performance |
| ackman | RTL8169 driver no longer functioning with 8111b |
| Patrick McHardy | pkt_sched: add DRR scheduler |
| denys | NMI lockup, 2.6.26 release |
| Felix Radensky | RE: e1000e "Detected Tx Unit Hang" |
| Kernel Panic when schedule is called | 51 minutes ago | Linux kernel |
| VPN's on NetBSD | 14 hours ago | NetBSD |
| Why does uClinux 2.6.18 bootup block SuperIO UART IRQs that BIOS configured | 15 hours ago | Linux kernel |
| USB statistics | 16 hours ago | Linux kernel |
| Block Sub System query | 21 hours ago | Linux kernel |
| kernel module to intercept socket creation | 22 hours ago | Linux kernel |
| Image size changing during each build | 22 hours ago | Linux kernel |
| Soft lock bug | 1 day ago | Linux kernel |
| sysctl - dynamic registration problem | 1 day ago | Linux kernel |
| Question on swap as ramdisk partition | 1 day ago | Linux kernel |
