Skip to content

Instantly share code, notes, and snippets.

@troter
Created April 28, 2014 07:59
Show Gist options
  • Save troter/11364851 to your computer and use it in GitHub Desktop.
Save troter/11364851 to your computer and use it in GitHub Desktop.
diff-highlight、diffの内容が「新規ファイル追加、変更」の順の場合、新規ファイル追加の内容の出力位置がずれる。
% cat hoge.txt
--- /dev/null
+++ b/new.txt
@@ -0,0 +1,1 @@
+aaa
diff --git a/exist.txt b/exist.txt
index 1d95c52..8bffa50 100644
@@ -0,0 +1,1 @@
-bbbb
+aaaa
% cat hoge.txt | diff-highlight
--- /dev/null
+++ b/new.txt
@@ -0,0 +1,1 @@
diff --git a/exist.txt b/exist.txt
index 1d95c52..8bffa50 100644
+aaa
@@ -0,0 +1,1 @@
-bbbb
+aaaa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment