Re: push specific line



I agree with you on your general philosophy for VCSes, but the comparison to git-gui is a bit of a stretch for me. Git-gui shows changes in unified diff format. This means a deletion is shown as it's own line. It also means if you have a block of changed lines it will be shown separately as a few lines removed, plus a few lines added. This is functionally different from meld's display which shows lines modified side by side. Consider that you have 5 lines modified to 10 lines between your two files. Now you want to keep the original 5 lines, plus your 1 line fix, discarding 4 lines, which might be debug prints or something. In git-gui you could click the one line you want and select stage for commit. How would this work in meld? You would hold down your modifier key, which would cause the first block to show 10 lines, 10 arrows, and the second block to show what? Also 10 lines with 5 blank? If only 5 lines, at which point in the opposing block do you insert the new line if you select a single line to merge? Above? Below? Somewhere in the middle? Even if you do expand to show blank lines changes are they won't really align where you want them to all the time, and in that case you'll be back to copy/paste like you have to now.

Also, I think you misread my statement. I said code complication, not code compilation.

Anyway, I'm not exactly actively contributing code to meld, so if Kai, et al thinks there can be a clean, useful implementation, that's fine. Just seemed like more trouble than it's worth since the exact functionality you're asking for is already present with one or two extra clicks.

On Thu, Feb 10, 2011 at 1:35 PM, Victor Engmark <victor engmark gmail com> wrote:
On Thu, Feb 10, 2011 at 9:34 PM, David Kelley <dskelley gmail com> wrote:
> On Thu, Feb 10, 2011 at 1:45 AM, Kai <kai willadsen gmail com> wrote:
>>
>> On 6 February 2011 19:39, Victor Engmark <victor engmark gmail com> wrote:
>> > On Wed, Feb 2, 2011 at 8:28 PM, Roee Shapiro <roeeshapiro gmail com>
>> > wrote:
>> >> Hello
>> >> I enjoy using meld.
>> >> I see there is a push to right/left feature which is for a single
>> >> block.
>> >> I am looking for the option to push a single line (out of the block),
>> >> Does it exist ?
>> >
>> > Bump. A similar feature exists in git-gui, where you can right-click
>> > on a line (or selection of lines) and say "Stage Line For Commit".
>>
>> The git-gui feature is completely different though. In git-gui, you
>> have one line for each insertion and deletion. We could replicate this
>> feature for insertions (and equivalently, deletions) but I don't see
>> how it would work for modified blocks (i.e., insert/delete pairs).
>>
>> > In
>> > kdiff3, IIRC, you could also split chunks of diff lines into two at
>> > the line where the pointer is, which I thought was even more clever.
>> > It would then recompute the diff, so you could sometimes use that to
>> > make it easier to resolve moved chunks (which it does not detect).
>>
>> Sorry, but from this description, I can't understand what this
>> splitting actually accomplishes.
>
> I don't see a big need for a 'merge specific line' feature. Both panes of
> meld are full text editors. Simply highlight the line in one side, copy/cut,
> move the cursor to the right position in the other side, paste. A merge
> specific line feature would be complicated to impliment, especially because
> it's not clean in all situations (modified [blue] blocks).
>
> While a 'merge specific line' feature would possibly reduce that particular
> scenario by a few clicks, is it worth the effort/complication of code? How
> often do most people need to do this operation? Isn't the existing
> functionality sufficient to handle this case?

I can't speak for other developers, but for me this is the single most
useful feature for achieving *commits with a single change*. I
constantly find that when fixing a bug I've done some cleanup of the
code which is completely irrelevant for the (usually much shorter)
actual fix. Committing these together makes it more difficult to
*untangle the version history at a later time*, which I consider the
raison d'être for VCSes (as opposed to just backup as it seems to be
in some companies). git-gui handles this wonderfully - Right-click and
select "Stage Hunk For Commit" or "Stage Line For Commit" (which also
works on multiple selected lines). Since Subversion and other
<del>obsolete</del><ins>old</ins> VCSes don't have a staging area this
of course becomes a bit more cumbersome, but it is a great timesaver.

As for the implementation, it could simply be another modifier like
Shift and Ctrl (Maybe we could use Alt?) to change from one arrow per
chunk to one arrow per line. And I doubt the developers of Meld are
daunted by the prospect of having to compile their own code.

Cheers,
--
Victor Engmark



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