Re: Commit only some changes



On Fri, Nov 20, 2009 at 9:28 AM, Vincent Legoll
<vincent legoll gmail com> wrote:
> On Thu, Nov 19, 2009 at 8:24 PM, Leif Gruenwoldt <leifer gmail com> wrote:
>> Often I make several changes to a file but only want to commit part of
>> those changes. Is there a way to pick which changes to commit with
>> Meld?
>
> Not directly, but this could be an interesting addition,
> and probably not too hard to implement...
>
> With git, what I do is use "git stash" before using meld to undo
> the unwanted changes, commit the pieces I want, and then
> use "git stash apply" to get back the other pieces back in.
>
> With other scm I did the equivalent by hand, i.e. copy the current
> files, undo unwanted modifs before comitting then checkout and
> overwrite with backup, A lot more painful if you have a lot of modified
> files...
>
> --
> Vincent Legoll
>

Vincent, your second example is pretty much what I have to do on a
regular basis with our scm (CVS). It works but obviously it's painful.
Beacuse it's painful many developers will just commit several
unrelated changes made to the file together leading to ugly diffs and
hard code reviews.

An example of the workflow that I think would be very useful in Meld
to rectify this would be:

1. Make a bunch of changes to myfile.c in my preferred editor.
2. View the diff in meld

$ meld myfile.c

Opens a diff between the version from my SCM (in the left pane) and
locally modified file (in the right pane.). Just like in the current
Meld. Nothing new here.

3. Pick which changes I want to check in by pushing them to the left.

The functionality is almost there now for this, except pushing to the
left just pushes to a file in /tmp/ on the filesystem.

4. Commit the file on the left through Meld. Right-click window pane,
select "commit" ?

-- 
Leif Gruenwoldt


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]