[Gllug] Mercurial or Subversion for single user?

Richard Jones rich at annexia.org
Wed Mar 24 18:17:13 UTC 2010


On Wed, Mar 24, 2010 at 05:46:35PM +0000, - Tethys wrote:
> On Wed, Mar 24, 2010 at 5:09 PM, Richard Jones <rich at annexia.org> wrote:
> 
> > Don't forget the awesome power of the 's' key (in git add -p mode),
> > which splits up the hunks to be smaller and smaller.  This means you
> > can split up even closely related changes.
> 
> At work, we went from darcs to git, adn now back to darcs again. The
> single thing I miss most about git is the 's' key in "add -p" mode.
> 
> > And (I discovered the other day) you can even edit the hunks
> > manually before they get added.
> 
> How? Even splitting patches wasn't always fine-grained enough for me,
> and it only let me split the patch into multiple hunks as defined by
> diff. I sometimes wanted to further subdivide an individual hunk,
> when multiple logical changes affected a single block of code, but
> couldn't see a way to do it.

Press 'e' (edit) during add -p:

# Manual hunk edit mode -- see bottom for a quick guide
@@ -1,4 +1,2 @@
 a
-b
-c
 d
# ---
# To remove '-' lines, make them ' ' lines (context).
# To remove '+' lines, delete them.
# Lines starting with # will be removed.
#
# If the patch applies cleanly, the edited hunk will immediately be
# marked for staging. If it does not apply cleanly, you will be given
# an opportunity to edit again. If all lines of the hunk are removed,
# then the edit is aborted and the hunk is left unchanged.

Rich.

-- 
Richard Jones
Red Hat
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list