Junio C Hamano <gitster@pobox.com> writes:Having said that, I think this comment is not quite right. + else if (!index_only) { + /* It's not dangerous to git-rm --cached a + * file if the index matches the file or the + * HEAD, since it means the deleted content is + * still available somewhere. + */ Personally I do not think "rm --cached" needs any such "safety", even though I'll keep the check for now, primarily because loosening the restriction later is always easier than adding new restriction. I really do not think this is about protecting the user from "deleted content is not available anywhere else". In this sequence: edit a-new-file git add a-new-file edit a-new-file git add a-new-file we do not complain, even though we are *losing* the contents we earlier staged. If you replace the second "git add" with "git-rm --cached", the sequence should work the same way. In either case, you are working towards your next commit, and most likely are doing a partial commit (iow, your working tree does not match any of the commit you create in the middle). Earlier you thought you would want one state of the file in the next commit, but now you decided against putting that new file in the first commit in the series. You may make further updates to the index and would make a commit, but after making the commit, your working tree still has "a-new-file" and you can add the contents from it for the later commit. - 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
| Adrian Bunk | Re: Linux 2.6.21 |
| Eric W. Biederman | Re: [PATCH] kexec: force x86_64 arches to boot kdump kernels on boot cpu |
| Gene Heskett | Re: [PATCH][RSDL-mm 0/7] RSDL cpu scheduler for 2.6.21-rc3-mm2 |
| Mel Gorman | Re: 2.6.21-rc7-mm2 -- x86_64 VDSO compile error |
git: | |
| David Miller | Re: Git and GCC |
| Paolo Ciarrocchi | Question about "git commit -a" |
| Abdelrazak Younes | Git-windows and git-svn? |
| Steven Grimm | Re: Git User's Survey 2007 |
| Kai Römer | Re: GPS |
| Thomas MIGLINCI | AW: 2.5mm or 3.5mm |
| Alexey Feldgendler | Re: Neo as cellular modem? |
| ian douglas | Re: SanDisk micro SDHC 8GB card under testing |
| Richard Stallman | Real men don't attack straw men |
| Marcos Laufer | dmesg IBM x3650 OpenBSD 4.3 |
| L. V. Lammert | Re: About Xen: maybe a reiterative question but .. |
| Michael | Performance: OpenVPN vs IPsec |
| Shared swap partition | 5 hours ago | Linux general |
| high memory | 2 days ago | Linux kernel |
| semaphore access speed | 2 days ago | Applications and Utilities |
| the kernel how to power off the machine | 2 days ago | Linux kernel |
| Easter Eggs in windows XP | 2 days ago | Windows |
| Root password | 2 days ago | Linux general |
| Where/when DNOTIFY is used? | 2 days ago | Linux kernel |
| How to convert Linux Kernel built-in module into a loadable module | 2 days ago | Linux kernel |
| Linux 2.6.24 and I/O schedulers | 2 days ago | Linux kernel |
| USB Driver -- Interrupt Polling -- A Little Help Please | 2 days ago | Linux general |
