Any Text File Merge Tools?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite
1












When I do version control on text (or latex) files I often run into the problem that the merge/diff tools are all line based while text files are not. This leads to insufficient granularity: every paragraph with the slightest change marked as different or, with hard wrap, every line after reflow of paragraph marked as different.



Are there any tools specifically for comparing/merging text files which avoid this problem? Ideally, this would let me revert at a sentence or sub-sentence granularity level and intelligently group changes.



I'm aware that latex-diff exists and that may be great for visualizing changes. I want a tool that works on the source.




EDIT: Since all the merge programs seem to be line based (wdiff is nice but without line numbers and merge functionality not appropriate) a stopgap solution would be a merge program that made it easy to select part of a line to revert (or even made it easy to just jump in and edit the line by hand during the merge). I'm currently using Filemerge on os x which doesn't seem to allow this (ideally it would be GUI as I don't use it enough to warrant memorizing keystrokes).



Still I would prefer something specifically designed to allow this. I wouldn't think it would be that hard.







share|improve this question


















  • 1




    A different diff tool may be helpful in this case - found a related question, the answer there recommends using wdiff -al <file1> <file2> since wdiff does a word-by-word comparison instead of lines. A few other nice suggestions too - stackoverflow.com/questions/2604915/…
    – ivanivan
    Dec 26 '17 at 2:31











  • Maybe try meld.
    – muru
    Dec 26 '17 at 6:38










  • @muru That works line-based, too, as it is a devloper tool.
    – Murphy
    Dec 27 '17 at 18:33














up vote
2
down vote

favorite
1












When I do version control on text (or latex) files I often run into the problem that the merge/diff tools are all line based while text files are not. This leads to insufficient granularity: every paragraph with the slightest change marked as different or, with hard wrap, every line after reflow of paragraph marked as different.



Are there any tools specifically for comparing/merging text files which avoid this problem? Ideally, this would let me revert at a sentence or sub-sentence granularity level and intelligently group changes.



I'm aware that latex-diff exists and that may be great for visualizing changes. I want a tool that works on the source.




EDIT: Since all the merge programs seem to be line based (wdiff is nice but without line numbers and merge functionality not appropriate) a stopgap solution would be a merge program that made it easy to select part of a line to revert (or even made it easy to just jump in and edit the line by hand during the merge). I'm currently using Filemerge on os x which doesn't seem to allow this (ideally it would be GUI as I don't use it enough to warrant memorizing keystrokes).



Still I would prefer something specifically designed to allow this. I wouldn't think it would be that hard.







share|improve this question


















  • 1




    A different diff tool may be helpful in this case - found a related question, the answer there recommends using wdiff -al <file1> <file2> since wdiff does a word-by-word comparison instead of lines. A few other nice suggestions too - stackoverflow.com/questions/2604915/…
    – ivanivan
    Dec 26 '17 at 2:31











  • Maybe try meld.
    – muru
    Dec 26 '17 at 6:38










  • @muru That works line-based, too, as it is a devloper tool.
    – Murphy
    Dec 27 '17 at 18:33












up vote
2
down vote

favorite
1









up vote
2
down vote

favorite
1






1





When I do version control on text (or latex) files I often run into the problem that the merge/diff tools are all line based while text files are not. This leads to insufficient granularity: every paragraph with the slightest change marked as different or, with hard wrap, every line after reflow of paragraph marked as different.



Are there any tools specifically for comparing/merging text files which avoid this problem? Ideally, this would let me revert at a sentence or sub-sentence granularity level and intelligently group changes.



I'm aware that latex-diff exists and that may be great for visualizing changes. I want a tool that works on the source.




EDIT: Since all the merge programs seem to be line based (wdiff is nice but without line numbers and merge functionality not appropriate) a stopgap solution would be a merge program that made it easy to select part of a line to revert (or even made it easy to just jump in and edit the line by hand during the merge). I'm currently using Filemerge on os x which doesn't seem to allow this (ideally it would be GUI as I don't use it enough to warrant memorizing keystrokes).



Still I would prefer something specifically designed to allow this. I wouldn't think it would be that hard.







share|improve this question














When I do version control on text (or latex) files I often run into the problem that the merge/diff tools are all line based while text files are not. This leads to insufficient granularity: every paragraph with the slightest change marked as different or, with hard wrap, every line after reflow of paragraph marked as different.



Are there any tools specifically for comparing/merging text files which avoid this problem? Ideally, this would let me revert at a sentence or sub-sentence granularity level and intelligently group changes.



I'm aware that latex-diff exists and that may be great for visualizing changes. I want a tool that works on the source.




EDIT: Since all the merge programs seem to be line based (wdiff is nice but without line numbers and merge functionality not appropriate) a stopgap solution would be a merge program that made it easy to select part of a line to revert (or even made it easy to just jump in and edit the line by hand during the merge). I'm currently using Filemerge on os x which doesn't seem to allow this (ideally it would be GUI as I don't use it enough to warrant memorizing keystrokes).



Still I would prefer something specifically designed to allow this. I wouldn't think it would be that hard.









share|improve this question













share|improve this question




share|improve this question








edited Dec 31 '17 at 10:13

























asked Dec 26 '17 at 1:09









Peter Gerdes

1114




1114







  • 1




    A different diff tool may be helpful in this case - found a related question, the answer there recommends using wdiff -al <file1> <file2> since wdiff does a word-by-word comparison instead of lines. A few other nice suggestions too - stackoverflow.com/questions/2604915/…
    – ivanivan
    Dec 26 '17 at 2:31











  • Maybe try meld.
    – muru
    Dec 26 '17 at 6:38










  • @muru That works line-based, too, as it is a devloper tool.
    – Murphy
    Dec 27 '17 at 18:33












  • 1




    A different diff tool may be helpful in this case - found a related question, the answer there recommends using wdiff -al <file1> <file2> since wdiff does a word-by-word comparison instead of lines. A few other nice suggestions too - stackoverflow.com/questions/2604915/…
    – ivanivan
    Dec 26 '17 at 2:31











  • Maybe try meld.
    – muru
    Dec 26 '17 at 6:38










  • @muru That works line-based, too, as it is a devloper tool.
    – Murphy
    Dec 27 '17 at 18:33







1




1




A different diff tool may be helpful in this case - found a related question, the answer there recommends using wdiff -al <file1> <file2> since wdiff does a word-by-word comparison instead of lines. A few other nice suggestions too - stackoverflow.com/questions/2604915/…
– ivanivan
Dec 26 '17 at 2:31





A different diff tool may be helpful in this case - found a related question, the answer there recommends using wdiff -al <file1> <file2> since wdiff does a word-by-word comparison instead of lines. A few other nice suggestions too - stackoverflow.com/questions/2604915/…
– ivanivan
Dec 26 '17 at 2:31













Maybe try meld.
– muru
Dec 26 '17 at 6:38




Maybe try meld.
– muru
Dec 26 '17 at 6:38












@muru That works line-based, too, as it is a devloper tool.
– Murphy
Dec 27 '17 at 18:33




@muru That works line-based, too, as it is a devloper tool.
– Murphy
Dec 27 '17 at 18:33










1 Answer
1






active

oldest

votes

















up vote
0
down vote













All the graphical diff tools I know of (Meld, KDiff3, Kompare, vimdiff) are working line-based, as they are developer tools. However I see a possibility to tweak them so you may be able to use them for your purpose. It depends on whether you can do without the linebreaks (newlines, ASCII 10) in your source files within paragraphs, or are able to remove them temporarily for the comparison and reformat the source later.



In this case you could compare the texts by merging the paragraphs into one single line. Meld for instance has a setting for linewrapping for better readability (no hard linebreaks inserted), and also the possibility to define text filters which enable you to ignore irrelevant content, e. g. formatting tags/commands. I made a little HTML example to show you what I'm thinking of:



Meld diffing lorem text with HTML tags



The (crude, overgeneralizing and very basic) Python regex for HTML tags is <.*?>.






share|improve this answer






















  • Yah, I already have all paragraphs as single lines. What I want is to be able to merge PARTS of a line, e.g., select one sentence to revert and leave the next one unchanged.
    – Peter Gerdes
    Dec 31 '17 at 10:08










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f413045%2fany-text-file-merge-tools%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













All the graphical diff tools I know of (Meld, KDiff3, Kompare, vimdiff) are working line-based, as they are developer tools. However I see a possibility to tweak them so you may be able to use them for your purpose. It depends on whether you can do without the linebreaks (newlines, ASCII 10) in your source files within paragraphs, or are able to remove them temporarily for the comparison and reformat the source later.



In this case you could compare the texts by merging the paragraphs into one single line. Meld for instance has a setting for linewrapping for better readability (no hard linebreaks inserted), and also the possibility to define text filters which enable you to ignore irrelevant content, e. g. formatting tags/commands. I made a little HTML example to show you what I'm thinking of:



Meld diffing lorem text with HTML tags



The (crude, overgeneralizing and very basic) Python regex for HTML tags is <.*?>.






share|improve this answer






















  • Yah, I already have all paragraphs as single lines. What I want is to be able to merge PARTS of a line, e.g., select one sentence to revert and leave the next one unchanged.
    – Peter Gerdes
    Dec 31 '17 at 10:08














up vote
0
down vote













All the graphical diff tools I know of (Meld, KDiff3, Kompare, vimdiff) are working line-based, as they are developer tools. However I see a possibility to tweak them so you may be able to use them for your purpose. It depends on whether you can do without the linebreaks (newlines, ASCII 10) in your source files within paragraphs, or are able to remove them temporarily for the comparison and reformat the source later.



In this case you could compare the texts by merging the paragraphs into one single line. Meld for instance has a setting for linewrapping for better readability (no hard linebreaks inserted), and also the possibility to define text filters which enable you to ignore irrelevant content, e. g. formatting tags/commands. I made a little HTML example to show you what I'm thinking of:



Meld diffing lorem text with HTML tags



The (crude, overgeneralizing and very basic) Python regex for HTML tags is <.*?>.






share|improve this answer






















  • Yah, I already have all paragraphs as single lines. What I want is to be able to merge PARTS of a line, e.g., select one sentence to revert and leave the next one unchanged.
    – Peter Gerdes
    Dec 31 '17 at 10:08












up vote
0
down vote










up vote
0
down vote









All the graphical diff tools I know of (Meld, KDiff3, Kompare, vimdiff) are working line-based, as they are developer tools. However I see a possibility to tweak them so you may be able to use them for your purpose. It depends on whether you can do without the linebreaks (newlines, ASCII 10) in your source files within paragraphs, or are able to remove them temporarily for the comparison and reformat the source later.



In this case you could compare the texts by merging the paragraphs into one single line. Meld for instance has a setting for linewrapping for better readability (no hard linebreaks inserted), and also the possibility to define text filters which enable you to ignore irrelevant content, e. g. formatting tags/commands. I made a little HTML example to show you what I'm thinking of:



Meld diffing lorem text with HTML tags



The (crude, overgeneralizing and very basic) Python regex for HTML tags is <.*?>.






share|improve this answer














All the graphical diff tools I know of (Meld, KDiff3, Kompare, vimdiff) are working line-based, as they are developer tools. However I see a possibility to tweak them so you may be able to use them for your purpose. It depends on whether you can do without the linebreaks (newlines, ASCII 10) in your source files within paragraphs, or are able to remove them temporarily for the comparison and reformat the source later.



In this case you could compare the texts by merging the paragraphs into one single line. Meld for instance has a setting for linewrapping for better readability (no hard linebreaks inserted), and also the possibility to define text filters which enable you to ignore irrelevant content, e. g. formatting tags/commands. I made a little HTML example to show you what I'm thinking of:



Meld diffing lorem text with HTML tags



The (crude, overgeneralizing and very basic) Python regex for HTML tags is <.*?>.







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 27 '17 at 19:44

























answered Dec 27 '17 at 19:21









Murphy

1,7471517




1,7471517











  • Yah, I already have all paragraphs as single lines. What I want is to be able to merge PARTS of a line, e.g., select one sentence to revert and leave the next one unchanged.
    – Peter Gerdes
    Dec 31 '17 at 10:08
















  • Yah, I already have all paragraphs as single lines. What I want is to be able to merge PARTS of a line, e.g., select one sentence to revert and leave the next one unchanged.
    – Peter Gerdes
    Dec 31 '17 at 10:08















Yah, I already have all paragraphs as single lines. What I want is to be able to merge PARTS of a line, e.g., select one sentence to revert and leave the next one unchanged.
– Peter Gerdes
Dec 31 '17 at 10:08




Yah, I already have all paragraphs as single lines. What I want is to be able to merge PARTS of a line, e.g., select one sentence to revert and leave the next one unchanged.
– Peter Gerdes
Dec 31 '17 at 10:08












 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f413045%2fany-text-file-merge-tools%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)