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


Groups > comp.lang.python > #68833

Re: Question about Source Control

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <cameron@cskk.homeip.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; '(all': 0.07; 'context': 0.07; 'debug': 0.07; 'debugging': 0.07; 'diff': 0.07; 'modified': 0.07; 'subject:Question': 0.07; 'git': 0.09; 'insertion': 0.09; 'lines.': 0.09; 'statements': 0.09; 'subject:Source': 0.09; 'cc:addr:python-list': 0.11; 'changes': 0.15; '(either': 0.16; '(everything': 0.16; '11:19': 0.16; '24,': 0.16; 'agree.': 0.16; 'alexander': 0.16; 'chunks.': 0.16; 'extension,': 0.16; 'fond': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'received:cskk.homeip.net': 0.16; 'received:homeip.net': 0.16; 'simpson': 0.16; 'unchanged': 0.16; 'files.': 0.16; 'ignore': 0.16; 'wrote:': 0.18; 'commit': 0.19; 'file,': 0.19; 'work,': 0.20; 'cc:addr:python.org': 0.22; 'header:User-Agent:1': 0.23; 'lets': 0.24; 'mon,': 0.24; 'versions': 0.24; 'cheers,': 0.24; 'file.': 0.24; '(or': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'chris': 0.29; 'am,': 0.29; 'related': 0.29; "i'm": 0.30; 'lines': 0.31; 'approve': 0.31; 'enjoyed': 0.31; 'file': 0.32; '"the': 0.34; 'could': 0.34; "can't": 0.35; 'but': 0.35; 'add': 0.35; 'really': 0.36; 'done': 0.36; 'next': 0.36; 'charset:us-ascii': 0.36; 'similar': 0.36; 'half': 0.37; 'basis.': 0.38; 'little': 0.38; 'enough': 0.39; 'either': 0.39; 'consists': 0.60; 'temporarily': 0.60; 'entire': 0.61; 'simple': 0.61; 'content- disposition:inline': 0.62; 'making': 0.63; 'choose': 0.64; 'pick': 0.64; 'to:addr:gmail.com': 0.65; 'here': 0.66; 'mar': 0.68; 'containing': 0.69; 'partial': 0.84; 'received:192.168.15': 0.84; 'reduced.': 0.84; 'restores': 0.84; 'subject:Control': 0.84; 'absolutely': 0.87
Date Mon, 24 Mar 2014 12:07:13 +1100
From Cameron Simpson <cs@zip.com.au>
To Chris Angelico <rosuav@gmail.com>
Subject Re: Question about Source Control
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
In-Reply-To <CAPTjJmoJxBF2mgkUrKyD9DZmwGSmHHVskD9vR+exq7U49mkMmQ@mail.gmail.com>
User-Agent Mutt/1.5.21 (2010-09-15)
References <CAPTjJmoJxBF2mgkUrKyD9DZmwGSmHHVskD9vR+exq7U49mkMmQ@mail.gmail.com>
Cc "python-list@python.org" <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.8428.1395623241.18130.python-list@python.org> (permalink)
Lines 42
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1395623241 news.xs4all.nl 2844 [2001:888:2000:d::a6]:55403
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:68833

Show key headers only | View raw


On 24Mar2014 11:30, Chris Angelico <rosuav@gmail.com> wrote:
> 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.
> > [...] 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. [...]
> 
> 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". [...]
> 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. [...]

"hg record" has the same issue; you get to approve or ignore single
diff chunks.

However, there's no fundamental technical reason you can't pick and
choose arbitrary lines.

Based on things I've experienced use "hg record", it pretty clearly
walks the user through the diff picking/rejecting chunks, and then
temporarily replaces the target file(s) with versions containing
only the selected diff chunks, and commits the files. Then it
restores the original modified file, whose diff from the "tip" is
now reduced.

With some work, that could be done on a line-by-line basis.

Cheers,
-- 
Cameron Simpson <cs@zip.com.au>

I've always been a big Greenaway fan - I've seen and enjoyed "The Falls" for
crying out loud.        - Peter Alexander Merel <pete@extro.ucc.su.OZ.AU>

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


Thread

Re: Question about Source Control Cameron Simpson <cs@zip.com.au> - 2014-03-24 12:07 +1100

csiph-web