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


Groups > comp.lang.python > #68826

Re: Question about Source Control

References <CAPTjJmpotXCzkB3NMh9xnJfCVGCeAsYpz6F4VaMA0wZKdqyJQQ@mail.gmail.com> <20140324001953.GA70218@cskk.homeip.net>
Date 2014-03-24 11:30 +1100
Subject Re: Question about Source Control
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.8424.1395621032.18130.python-list@python.org> (permalink)

Show all headers | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web