Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #68826 > unrolled thread

Re: Question about Source Control

Started byChris Angelico <rosuav@gmail.com>
First post2014-03-24 11:30 +1100
Last post2014-03-24 11:30 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Question about Source Control Chris Angelico <rosuav@gmail.com> - 2014-03-24 11:30 +1100

#68826 — Re: Question about Source Control

FromChris Angelico <rosuav@gmail.com>
Date2014-03-24 11:30 +1100
SubjectRe: Question about Source Control
Message-ID<mailman.8424.1395621032.18130.python-list@python.org>
On Mon, Mar 24, 2014 at 11:19 AM, Cameron Simpson <cs@zip.com.au> wrote:
> I'm particularly fond of "hg record" (or the similar extension, "hg
> crecord"), which lets you commit just parts of a modified file.
>
> When I'm in a debugging branch, it gradually turns into a huge diff.
> "hg record" lets me commit specific parts of a diff in a single
> commit. Every so often I spent a little while cleaning out related
> changes that are going to stay so that the final diffness consists
> of debug statements and hacks-in-progress; much smaller.
>
> So I'll pick a file and run an "hg record that-file" and pick all
> the diff parts that involve, say, removing some parameter. And in
> goes a single commit with just that feature change. Lather, rinse,
> repeat for other small concrete changes.
>
> And then my "hg diff" is back to being managably readable.
>

Absolutely agree. With git, the same functionality can be done by
making use of the staging area; you can either add an entire file (all
its changes), or do a partial add with "git add -p" or (more
conveniently, but requires a GUI) "git gui". I do that *very*
frequently. The only thing I would really like is a simple way to say
"stage/commit the lines from here to there"; with git gui, I can
either stage an entire hunk (everything until the next point where
there's enough unchanged lines that the context breaks) or a single
line (either an insertion or a removal). Gets tedious when you want to
stage half of a large hunk. But other than that, yes, the
functionality is awesome, letting you fidget your edits into readable
commits.

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web