After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 727600 - Add the command to push/pull just single or selected lines
Add the command to push/pull just single or selected lines
Status: RESOLVED OBSOLETE
Product: meld
Classification: Other
Component: filediff
1.8.x
Other All
: Normal enhancement
: ---
Assigned To: meld-maint
meld-maint
: 768344 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-04-04 11:22 UTC by xhpohanka
Modified: 2017-12-13 19:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
compare two files with meld and merge single lines (1.12 KB, application/zip)
2016-06-20 12:03 UTC, claudio
Details

Description xhpohanka 2014-04-04 11:22:20 UTC
When comparing files using Meld one can copy (delete, add) differing blocks between left and right panels easily however I'm lacking possibility to do the same just with a part of this block or single line in minimum.

Can this feature be added into meld?

So far the only option is to copy the text using clipboard or I'm missing something?

thanks
Jan
Comment 1 Kai Willadsen 2014-04-12 20:43:45 UTC
I wouldn't be against adding this. Figuring out how to do the UI is the challenge... I haven't come up with any obvious solutions for allowing per-line changes visually in the gutters without breaking the current gutter actions. Also I think all of the likely keyboard shortcuts for this feature are taken already. Nonetheless, I'm fine with the idea in theory.
Comment 2 xhpohanka 2014-04-13 17:59:59 UTC
To the keyboard shortcut seletction - I think that connection of currently used ALT + arrow can be expanded to take selection in the account. If nothing is selected, copy whole block and just the selection otherwise (line is the minimum block to copy in this way)
Comment 3 Kai Willadsen 2014-04-17 20:50:38 UTC
(In reply to comment #2)
> To the keyboard shortcut seletction - I think that connection of currently used
> ALT + arrow can be expanded to take selection in the account. If nothing is
> selected, copy whole block and just the selection otherwise (line is the
> minimum block to copy in this way)

I'm not a fan of this behaviour, because it overloads what the action means, and it's going to be suprising to a lot of people. However...

...you've reminded me of what the actual problem here is, which is that we can't know which line to replace on the target side, and I can't think of any sane solution at all for that. Or at least, I can't think of a solution that isn't exactly as much work for the user as copy-paste.
Comment 4 claudio 2016-06-20 12:01:58 UTC
Hi,

I wanted to bring my feature request long time ago up again :-)
Now with some additional info and sample of two files to compare attached.

As I wrote, we use wincompare/compareit from Grigsoft:
http://www.grigsoft.com/wincmp3.htm
This prog exactly does what we want, see my older description and attached samples.
The prog is shareware, you can try the features, it only runs on windows.
But we also need a powerful compare prog on Linux and like meld very much.
Meanwhile compareit also is developed very slowly :-(
CompareIt uses the keys Ctrl+Alt Left/Right to copy only the current line and like meld
Alt Left/Right to copy the whole block, this  logically fits good.
See attached sample-files to compare ...

Regards,
Claudio
Comment 5 claudio 2016-06-20 12:03:01 UTC
Created attachment 330062 [details]
compare two files with meld and merge single lines
Comment 6 Kai Willadsen 2016-07-06 21:50:47 UTC
*** Bug 768344 has been marked as a duplicate of this bug. ***
Comment 7 Kai Willadsen 2016-07-06 21:53:26 UTC
See bug 768344 for a screencast demonstrating this feature.

My take on this is that this looks to me like it requires more information than Meld keeps around. At a minimum we'd need to:
 * maintain per-line corresponding line markers which we don't do; and
 * make sure that when we did inline highlighting, that was also aligned to line boundaries, which I'm not even convinced is a good idea.

Having said that, it seems like it might be cool.
Comment 8 Vasily Galkin 2016-09-28 11:54:33 UTC
I come to an idea how similar functional feature may behave in the meld-consistent way: it should operate not in terms of lines but in terms of an arbitrary selection being part of modified block.

Corresponding sub-block in the other pane can be found using exiting inline diff information. It seems that all of modified operations (replace, delete, copy up, copy down) can be applied to a subblock. (for blocks delete is already implemented via simple selection deletion, but see below).

Now returning to original feature: working in terms of lines. In many applications operations that require selection are falling back to assuming that selection is current line if selection is empty. So, if this sub-block-selection-wise operation would fall back to current line - this would implement both the originally formulated feature request and more powerful "apply the selected part of change"  mode
Comment 9 Kai Willadsen 2016-09-28 20:31:39 UTC
I agree more-or-less with what you've said, but even with your proposal we'd still need to do both of the points I mentioned in comment 7. These aren't impossible, they're just not trivial.
Comment 10 Phil Hord 2016-11-02 17:56:53 UTC
For what it's worth, BeyondCompare has a similar feature and is available for Linux as shareware/trialware. If anyone seeks an alternative or wants to try it out for themselves, it's available there (from scooter software). I am still looking for a foss tool that supports this as well.

For comparison and feature thoughts, here's a brief description of how it is implemented in BC.

Firstly, "missing" lines are gap-filled in BC so there is a clear target line for the copied line. This seems to be a requirement to make this work well visually.  In BC lines can be aligned manually when needed, so it works quite well in practice. 

The line-copy "mode" is visually chosen by clicking in the gutter _not on the arrow_ or by selecting text spanning one or more newlines in the editor. This conveniently allows multiple source lines to be selected for copy. Gutter-selection of lines using ctrl-click allows multiple noncontiguous source lines to be selected.

In the selected-lines mode, BC doesn't allow whole-block copying anymore.  Once a line is selected, the copy mode becomes "line only" and the toolbar icons change accordingly.  Therefore the keyboard shortcut remains the same. Ctrl-L copies to Left (block or line mode), and Ctrl-R copies to the Right.
Comment 11 GNOME Infrastructure Team 2017-12-13 19:07:50 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/meld/issues/72.