Re:Mercurial RFC of a new extension to directly operate on G...
by cannam on Wednesday October 30, 2019 @06:24AM
(#21396131)
This makes for one difference which sometimes bites people even if they use the two tools in the same way: if you change a file "while committing it", e.g. changing it in one window while writing the commit message in another, Mercurial will commit the changed version, while Git of course commits the file as it was when you staged it, or when you ran commit -a.
I find this quite handy in Mercurial, as I sometimes realise while writing the commit message that e.g. I forgot to remove a line of temporary debug output, and I can still go and do it before I save the commit message. But that's very bad form that reflects badly on me. The way Git does it feels more correct.
Re:Mercurial RFC of a new extension to directly operate on G...
by DaiPlusPlus on Tuesday October 29, 2019 @11:19PM
(#21394396)
What about committing partial changes to files (like git’s hunks)?
Re:Mercurial RFC of a new extension to directly operate on G...
by doubleunplussed on Wednesday October 30, 2019 @09:16AM
(#21397323)
Yes, hg's interactive commit allows this (and if you look at my screenshot, you can see tortoisehg presents checkboxes next to hunks in the diff, this is the way I use it)
Re:Mercurial RFC of a new extension to directly operate on G...
by rkangel on Wednesday October 30, 2019 @07:16AM
(#21396421)
I seem to remember using the hg record extension.
Re:Mercurial RFC of a new extension to directly operate on G...
by pseudalopex on Wednesday October 30, 2019 @12:15AM
(#21394651)
"hg commit -i" does that.
What Mercurial doesn't have is a separate repository concept of an incomplete commit that has awkward, and often inconsistent, interactions with several common repository commands. Git has this, and this is the staging area.
The UI feature you use has nothing to do with the staging area, and is in fact closer to the `hg commit -i` interactive commit mode.