[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    whitespace ignoring during diff -M
From:       Daniel Mierswa <impulze () impulze ! org>
Date:       2009-05-31 20:28:50
Message-ID: 4A22E882.8020500 () impulze ! org
[Download RAW message or body]

Hi list,
I was told to try it here after visiting #git/Freenode
I want git to think that the diff of two branches where filenames and
whitespace amount differ are the same.
The following is a snippet from my terminal with output, is there a
chance to make git think that those are equal?

impulze@istari ~/gittest $ git init
Initialized empty Git repository in /home/impulze/gittest/.git/
impulze@istari ~/gittest $ touch initial
impulze@istari ~/gittest $ git add initial && git commit initial -m
'initial commit'
[master (root-commit) 7b67dcd] initial commit
 0 files changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 initial
impulze@istari ~/gittest $ git checkout -b another
Switched to a new branch 'another'
impulze@istari ~/gittest $ echo -e "   abcdef   \n   ghijkl " > file.cc
impulze@istari ~/gittest $ unix2dos -a -u file.cc
impulze@istari ~/gittest $ git add file.cc && git commit file.cc -m
'another commit'
[another 37826f4] another commit
 1 files changed, 2 insertions(+), 0 deletions(-)
 create mode 100644 file.cc
impulze@istari ~/gittest $ git checkout master
Switched to branch 'master'
impulze@istari ~/gittest $ echo -e "\t\tabcdef\t\n\tghijkl\t" > file.c
impulze@istari ~/gittest $ git add file.c && git commit file.c -m
'master commit'
[master f9f0ac5] master commit
 1 files changed, 2 insertions(+), 0 deletions(-)
 create mode 100644 file.c
impulze@istari ~/gittest $ git --no-pager diff another -M -w
diff --git a/file.c b/file.c
new file mode 100644
index 0000000..18364be
--- /dev/null
+++ b/file.c
@@ -0,0 +1,2 @@
+               abcdef
+       ghijkl
diff --git a/file.cc b/file.cc
deleted file mode 100644
index 1a303ea..0000000
--- a/file.cc
+++ /dev/null
@@ -1,2 +0,0 @@
-   abcdef
-   ghijkl


-- 
Mierswa, Daniel

If you still don't like it, that's ok: that's why I'm boss. I simply
know better than you do.
               --- Linus Torvalds, comp.os.linux.advocacy, 1996/07/22
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic