diff

Removing trailing white space only for edited lines

廉价感情. 提交于 2019-12-05 01:21:19
I had added the following function in my .vimrc for removing trailing white spaces just before saving fun! <SID>StripTrailingWhitespaces() let l = line(".") let c = col(".") %s/\s\+$//e call cursor(l, c) endfun autocmd BufWritePre *.h :call <SID>StripTrailingWhitespaces() autocmd BufWritePre *.cpp :call <SID>StripTrailingWhitespaces() autocmd BufWritePre *.c :call <SID>StripTrailingWhitespaces() It works really well. However, in certain cases I would like to remove trailing white spaces only from lines that I have edited. This is to ensure that my diff output looks sane as for certain legacy

Can't convert string from 'UTF-8' to native encoding

流过昼夜 提交于 2019-12-05 01:09:35
I am getting the following error message when I try to compare my project in eclipse (Team->Compare): (Can't convert string from 'UTF-8' to native encoding) *** diff --old /Users/admin/Documents/workspace_branch_2.8/Test --new https://192.168.1.202/svn/main_repository/tenios/Voxtelo/bundle/trunk/Server/Test Invalid argument svn: Kann Zeichenkette nicht von »UTF-8« in die eigene Codierung konvertieren: svn: Eigenschafts?\195?\164nderungen: /Users/admin/Documents/workspace_branch_2.8/Test/src/main/java/org/test/test/internal/commands/Command.java ZM-Schicht Anforderung gescheitert svn: Fehler

Git: How to diff two different files in different commits?

旧街凉风 提交于 2019-12-05 00:56:46
I have a repository where a number of files have been renamed from .html to .php and further edited in a number of commits since my last pull. Using git diff to shows all the html contents removed and all the php content added. Is there a neat way to have git diff detect the renames (something like git log --follow does), or directly compare different filenames across different commits (something like the solution in Git: How to diff two different files in different branches? , but for commits)? You can always compare 2 files in 2 different commits: git diff commit1:file1_path commit2:file2

Are there any javascript libs for creating a nice structured (tree) diff for HTML?

耗尽温柔 提交于 2019-12-05 00:51:34
问题 I'm trying to come up with a solution to power a "history view" mechanism that we are using throughout a site. For the UI of this history view I'd like to show the user what changes occurred between two revisions of an object. In other words, a diff. This is a real challenge because the objects in question are all fairly complex. I figured the best approach was to render each object as HTML and then use some kind of diff tool on the generated HTML to present the differences to the user. The

Git granularity — resolving diffs within a line

断了今生、忘了曾经 提交于 2019-12-05 00:50:50
Is git line-based or diff granularity can be increased to a word/letter resolution? It is worth for multiple statements per line or using git for writing plain texts. torek On re-reading the question in light of the comments, I think I see what you were getting at originally, so I'll put in a real answer (vs Ismail Badawi's one line comment ). Git as simple storage Git has quite a collection of pieces, some of which play better together than others. At the lowest level, Git acts as a pure content-based datastore: a database with key/value pairs, where the key itself is simply (and always) the

Interactively merge files tracked with git and untracked local files

那年仲夏 提交于 2019-12-05 00:20:45
I use a couple of software packages (like gitlab) that you install by cloning from their git repo. They typically come with some config.example (under version control), which you copy to your own config file (not under version control or even ignored in .gitignore ) and adapt to your needs. When the upstream package is updated and for example changes the config file options that will obviously only be reflected in config.example . Is there a chain of git commands that i'm missing that can help me compare the changes of config.example to the new one in upstream/HEAD and maybe even merge them

How do I prettily print out a git-diff output?

蹲街弑〆低调 提交于 2019-12-04 23:42:17
for my upcoming Bachelor thesis, I am required to print out the git-diff output for the appendix of the paper. I really like the output of git diff --color-words , but I have absolutely no idea how to bring this - colored and with line numbers included - to a piece of paper on my Mac. I know there are tools like SourceTree , but even with those I seem not able to make a pretty print out of the single file's diffs. Well, I am pretty sure that I cannot be the only one with this problem, and I found some suggested ansi2html solutions, but they to not seem to work with my version of git (1.7.10.2)

How to let Mercurial show “hg out --patch” diff as visual diff?

心不动则不痛 提交于 2019-12-04 23:38:46
问题 It looks like hg out --patch or hg out -p is a good way to see what code is pushed out to the repo (when it is pushed)... but the diff is in text format. Is there a way to make it use kdiff3 as well? 回答1: hg outgoing --patch shows the changes in each changeset separately, which probably isn't what you want if you're looking for a visual representation. You more likely want the GUI equivalent of hg diff -r your_latest_changeset -r remote_servers_latest_changeset where the latest changesets are

How to use different merge and diff tool in git?

╄→尐↘猪︶ㄣ 提交于 2019-12-04 20:27:22
I prefer to use meld as the diff tool. However it doesn't have an option to quickly solve all simple conflicts so in case of merging I'd like to use kdiff3 I've set merge.tool to kdiff3 and diff.guitool to meld but git difftool still always run kdiff3 [merge] tool = kdiff3 conflictstyle = diff3 [diff] guitool = meld renames = copies mnemonicPrefix = true [difftool] prompt = false How to make git difftool run meld ? diff.guitool only applies if you use the --gui flag . Setting diff.tool and merge.tool should make git difftool and git mergetool use different tools: [merge] tool = kdiff3 [diff]

Free diff tool that is configurable? [closed]

柔情痞子 提交于 2019-12-04 18:44:05
Is there a diff tool that allows me to write regular expression to remove a line from difference? Like, see the two lines: this.Visible = true; Visible = true; And can I write an expression such that if the line difference is exactly this ignore the difference. How do I specifically do that? I give you one more example. Like System.Exception and Exception both are same for me, I don't want to show them in the diff. Greg Hewgill You can do this with KDiff3 . See the documentation section on Preprocessor Commands . Update : I see you have a further request that appears to need a semantic diff