Shelve extension

Martin Geisler mg at daimi.au.dk
Mon Feb 23 12:41:22 CST 2009


Peter Hosey <boredzo at gmail.com> writes:

> The [Git] index is really good for being able to commit separate
> changes as separate commits (the mixed-working-copy problem). Not only
> do you have interactive hunk selection (the record extension in hg;
> add -i in Git), but you don't have to commit them in the same
> operation like you do with hg record―instead, Git saves those
> selections in the index. You have all the time in the world to review
> the changes, add changes, remove changes (not interactively,
> unfortunately), review again, etc. until you commit.
>
> So you can, for example:
>
> 1. Add some changes to the index.
> 2. Go for lunch.
> 3. Review the index and working copy.
> 4. Find that you missed a change that should be in the index.
> 5. Add that.
> 6. Refill your coffee/tea/soda/water container.
> 7. Commit the index.
> 8. Review the working copy.
> 9. Add the rest of the changes.
> 10. Commit #2.
>
> I'm certainly not a frequent Git user, but I do think the index is its
> most important contribution to the field of version control.

When the changes are in separate files, is this any different from:

1. hg commit -m 'Fixed bug.' foo.c foo.h
2. Go for lunch.
3. Review the last commit and working copy.
4. Find that you missed a change that should be in the last commit.
5. hg revert; hg commit -m 'Fixed bug.' foo.c foo.h bar.c
6. Refill your coffee/tea/soda/water container.
7. -- no need to commit here
8. Review the working copy.
9. Add the rest of the changes.
10. Commit #2.

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial/attachments/20090223/47e9d5ff/attachment.pgp 


More information about the Mercurial mailing list