Skip to content

Commit

Permalink
t4013 diff format tests update
Browse files Browse the repository at this point in the history
This changes one test commit in the sequence to have more than
one lines of commit log.  A few output formats (--pretty=email
aka format-patch and --pretty=oneline) need to behave
differently on single and multi-line log, and this change will
help catching breakages.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Jul 14, 2006
1 parent 5716e79 commit a40d384
Show file tree
Hide file tree
Showing 42 changed files with 161 additions and 104 deletions.
5 changes: 4 additions & 1 deletion t/t4013-diff-various.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ test_description='Various diff formatting options'

. ./test-lib.sh

LF='
'

test_expect_success setup '
GIT_AUTHOR_DATE="2006-06-26 00:00:00 +0000" &&
Expand All @@ -31,7 +34,7 @@ test_expect_success setup '
for i in C D; do echo $i; done >>dir/sub &&
rm -f file2 &&
git update-index --remove file0 file2 dir/sub &&
git commit -m Second &&
git commit -m "Second${LF}${LF}This is the second commit." &&
GIT_AUTHOR_DATE="2006-06-26 00:02:00 +0000" &&
GIT_COMMITTER_DATE="2006-06-26 00:02:00 +0000" &&
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$ git diff-tree --cc --patch-with-stat --summary master
176b998f5d647cbd77a9d8acf4531e930754d16d
59d314ad6f356dd08601a4cd5e530381da3e3c64
dir/sub | 2 ++
file0 | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.diff-tree_--cc_--patch-with-stat_master
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$ git diff-tree --cc --patch-with-stat master
176b998f5d647cbd77a9d8acf4531e930754d16d
59d314ad6f356dd08601a4cd5e530381da3e3c64
dir/sub | 2 ++
file0 | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.diff-tree_--cc_--stat_--summary_master
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$ git diff-tree --cc --stat --summary master
176b998f5d647cbd77a9d8acf4531e930754d16d
59d314ad6f356dd08601a4cd5e530381da3e3c64
dir/sub | 2 ++
file0 | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.diff-tree_--cc_--stat_master
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$ git diff-tree --cc --stat master
176b998f5d647cbd77a9d8acf4531e930754d16d
59d314ad6f356dd08601a4cd5e530381da3e3c64
dir/sub | 2 ++
file0 | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.diff-tree_--cc_master
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$ git diff-tree --cc master
176b998f5d647cbd77a9d8acf4531e930754d16d
59d314ad6f356dd08601a4cd5e530381da3e3c64
diff --cc dir/sub
index cead32e,7289e35..992913c
--- a/dir/sub
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.diff-tree_-c_--abbrev_master
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$ git diff-tree -c --abbrev master
176b998f5d647cbd77a9d8acf4531e930754d16d
59d314ad6f356dd08601a4cd5e530381da3e3c64
::100644 100644 100644 cead32e... 7289e35... 992913c... MM dir/sub
::100644 100644 100644 b414108... f4615da... 10a8a9f... MM file0
$
2 changes: 1 addition & 1 deletion t/t4013/diff.diff-tree_-c_--stat_--summary_master
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$ git diff-tree -c --stat --summary master
176b998f5d647cbd77a9d8acf4531e930754d16d
59d314ad6f356dd08601a4cd5e530381da3e3c64
dir/sub | 2 ++
file0 | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.diff-tree_-c_--stat_master
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$ git diff-tree -c --stat master
176b998f5d647cbd77a9d8acf4531e930754d16d
59d314ad6f356dd08601a4cd5e530381da3e3c64
dir/sub | 2 ++
file0 | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
Expand Down
2 changes: 1 addition & 1 deletion t/t4013/diff.diff-tree_-c_master
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$ git diff-tree -c master
176b998f5d647cbd77a9d8acf4531e930754d16d
59d314ad6f356dd08601a4cd5e530381da3e3c64
::100644 100644 100644 cead32e925b1420c84c14cbf7cf755e7e45af8ad 7289e35bff32727c08dda207511bec138fdb9ea5 992913c5aa0a5476d10c49ed0f21fc0c6d1aedf3 MM dir/sub
::100644 100644 100644 b414108e81e5091fe0974a1858b4d0d22b107f70 f4615da674c09df322d6ba8d6b21ecfb1b1ba510 10a8a9f3657f91a156b9f0184ed79a20adef9f7f MM file0
$
4 changes: 2 additions & 2 deletions t/t4013/diff.diff-tree_-p_-m_master
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$ git diff-tree -p -m master
176b998f5d647cbd77a9d8acf4531e930754d16d
59d314ad6f356dd08601a4cd5e530381da3e3c64
diff --git a/dir/sub b/dir/sub
index cead32e..992913c 100644
--- a/dir/sub
Expand All @@ -21,7 +21,7 @@ index b414108..10a8a9f 100644
+A
+B
+C
176b998f5d647cbd77a9d8acf4531e930754d16d
59d314ad6f356dd08601a4cd5e530381da3e3c64
diff --git a/dir/sub b/dir/sub
index 7289e35..992913c 100644
--- a/dir/sub
Expand Down
15 changes: 9 additions & 6 deletions t/t4013/diff.format-patch_--attach_--stdout_initial..master
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$ git format-patch --attach --stdout initial..master
From 7952a93e09bf565b5592766a438b40cd81f4846f Mon Sep 17 00:00:00 2001
From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Mon, 26 Jun 2006 00:01:00 +0000
Subject: [PATCH] Second
Expand All @@ -11,17 +11,20 @@ This is a multi-part message in MIME format.
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit


This is the second commit.
---
dir/sub | 2 ++
file0 | 3 +++
file2 | 3 ---
3 files changed, 5 insertions(+), 3 deletions(-)
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch;
name="7952a93e09bf565b5592766a438b40cd81f4846f.diff"
name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline;
filename="7952a93e09bf565b5592766a438b40cd81f4846f.diff"
filename="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"

diff --git a/dir/sub b/dir/sub
index 35d242b..8422d40 100644
Expand Down Expand Up @@ -57,7 +60,7 @@ index 01e79c3..0000000



From 889b315013ef9f2e2f90aa0b054b267c8a557847 Mon Sep 17 00:00:00 2001
From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Mon, 26 Jun 2006 00:02:00 +0000
Subject: [PATCH] Third
Expand All @@ -75,10 +78,10 @@ Content-Transfer-Encoding: 8bit
2 files changed, 5 insertions(+), 0 deletions(-)
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch;
name="889b315013ef9f2e2f90aa0b054b267c8a557847.diff"
name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline;
filename="889b315013ef9f2e2f90aa0b054b267c8a557847.diff"
filename="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"

diff --git a/dir/sub b/dir/sub
index 8422d40..cead32e 100644
Expand Down
15 changes: 9 additions & 6 deletions t/t4013/diff.format-patch_--attach_--stdout_initial..master^
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$ git format-patch --attach --stdout initial..master^
From 7952a93e09bf565b5592766a438b40cd81f4846f Mon Sep 17 00:00:00 2001
From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Mon, 26 Jun 2006 00:01:00 +0000
Subject: [PATCH] Second
Expand All @@ -11,17 +11,20 @@ This is a multi-part message in MIME format.
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit


This is the second commit.
---
dir/sub | 2 ++
file0 | 3 +++
file2 | 3 ---
3 files changed, 5 insertions(+), 3 deletions(-)
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch;
name="7952a93e09bf565b5592766a438b40cd81f4846f.diff"
name="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline;
filename="7952a93e09bf565b5592766a438b40cd81f4846f.diff"
filename="1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44.diff"

diff --git a/dir/sub b/dir/sub
index 35d242b..8422d40 100644
Expand Down Expand Up @@ -57,7 +60,7 @@ index 01e79c3..0000000



From 889b315013ef9f2e2f90aa0b054b267c8a557847 Mon Sep 17 00:00:00 2001
From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Mon, 26 Jun 2006 00:02:00 +0000
Subject: [PATCH] Third
Expand All @@ -75,10 +78,10 @@ Content-Transfer-Encoding: 8bit
2 files changed, 5 insertions(+), 0 deletions(-)
--------------g-i-t--v-e-r-s-i-o-n
Content-Type: text/x-patch;
name="889b315013ef9f2e2f90aa0b054b267c8a557847.diff"
name="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline;
filename="889b315013ef9f2e2f90aa0b054b267c8a557847.diff"
filename="9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0.diff"

diff --git a/dir/sub b/dir/sub
index 8422d40..cead32e 100644
Expand Down
6 changes: 4 additions & 2 deletions t/t4013/diff.format-patch_--stdout_initial..master
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
$ git format-patch --stdout initial..master
From 7952a93e09bf565b5592766a438b40cd81f4846f Mon Sep 17 00:00:00 2001
From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Mon, 26 Jun 2006 00:01:00 +0000
Subject: [PATCH] Second

This is the second commit.
---
dir/sub | 2 ++
file0 | 3 +++
Expand Down Expand Up @@ -42,7 +44,7 @@ index 01e79c3..0000000
g-i-t--v-e-r-s-i-o-n


From 889b315013ef9f2e2f90aa0b054b267c8a557847 Mon Sep 17 00:00:00 2001
From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Mon, 26 Jun 2006 00:02:00 +0000
Subject: [PATCH] Third
Expand Down
6 changes: 4 additions & 2 deletions t/t4013/diff.format-patch_--stdout_initial..master^
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
$ git format-patch --stdout initial..master^
From 7952a93e09bf565b5592766a438b40cd81f4846f Mon Sep 17 00:00:00 2001
From 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Mon, 26 Jun 2006 00:01:00 +0000
Subject: [PATCH] Second

This is the second commit.
---
dir/sub | 2 ++
file0 | 3 +++
Expand Down Expand Up @@ -42,7 +44,7 @@ index 01e79c3..0000000
g-i-t--v-e-r-s-i-o-n


From 889b315013ef9f2e2f90aa0b054b267c8a557847 Mon Sep 17 00:00:00 2001
From 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0 Mon Sep 17 00:00:00 2001
From: A U Thor <author@example.com>
Date: Mon, 26 Jun 2006 00:02:00 +0000
Subject: [PATCH] Third
Expand Down
10 changes: 6 additions & 4 deletions t/t4013/diff.log_--patch-with-stat_--summary_master_--_dir_
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$ git log --patch-with-stat --summary master -- dir/
commit 176b998f5d647cbd77a9d8acf4531e930754d16d
Merge: 889b315... c7a2ab9...
commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
Merge: 9a6d494... c7a2ab9...
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000

Expand All @@ -25,7 +25,7 @@ index 35d242b..7289e35 100644
+1
+2

commit 889b315013ef9f2e2f90aa0b054b267c8a557847
commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:02:00 2006 +0000

Expand All @@ -45,11 +45,13 @@ index 8422d40..cead32e 100644
+E
+F

commit 7952a93e09bf565b5592766a438b40cd81f4846f
commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:01:00 2006 +0000

Second

This is the second commit.
---
dir/sub | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
Expand Down
10 changes: 6 additions & 4 deletions t/t4013/diff.log_--patch-with-stat_master
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$ git log --patch-with-stat master
commit 176b998f5d647cbd77a9d8acf4531e930754d16d
Merge: 889b315... c7a2ab9...
commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
Merge: 9a6d494... c7a2ab9...
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000

Expand Down Expand Up @@ -48,7 +48,7 @@ index 0000000..7289e35
+1
+2

commit 889b315013ef9f2e2f90aa0b054b267c8a557847
commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:02:00 2006 +0000

Expand Down Expand Up @@ -78,11 +78,13 @@ index 0000000..b1e6722
+B
+C

commit 7952a93e09bf565b5592766a438b40cd81f4846f
commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:01:00 2006 +0000

Second

This is the second commit.
---
dir/sub | 2 ++
file0 | 3 +++
Expand Down
10 changes: 6 additions & 4 deletions t/t4013/diff.log_--patch-with-stat_master_--_dir_
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$ git log --patch-with-stat master -- dir/
commit 176b998f5d647cbd77a9d8acf4531e930754d16d
Merge: 889b315... c7a2ab9...
commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
Merge: 9a6d494... c7a2ab9...
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000

Expand All @@ -25,7 +25,7 @@ index 35d242b..7289e35 100644
+1
+2

commit 889b315013ef9f2e2f90aa0b054b267c8a557847
commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:02:00 2006 +0000

Expand All @@ -45,11 +45,13 @@ index 8422d40..cead32e 100644
+E
+F

commit 7952a93e09bf565b5592766a438b40cd81f4846f
commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:01:00 2006 +0000

Second

This is the second commit.
---
dir/sub | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
Expand Down
10 changes: 6 additions & 4 deletions t/t4013/diff.log_--root_--cc_--patch-with-stat_--summary_master
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$ git log --root --cc --patch-with-stat --summary master
commit 176b998f5d647cbd77a9d8acf4531e930754d16d
Merge: 889b315... c7a2ab9...
commit 59d314ad6f356dd08601a4cd5e530381da3e3c64
Merge: 9a6d494... c7a2ab9...
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:04:00 2006 +0000

Expand Down Expand Up @@ -81,7 +81,7 @@ index 0000000..7289e35
+1
+2

commit 889b315013ef9f2e2f90aa0b054b267c8a557847
commit 9a6d4949b6b76956d9d5e26f2791ec2ceff5fdc0
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:02:00 2006 +0000

Expand Down Expand Up @@ -112,11 +112,13 @@ index 0000000..b1e6722
+B
+C

commit 7952a93e09bf565b5592766a438b40cd81f4846f
commit 1bde4ae5f36c8d9abe3a0fce0c6aab3c4a12fe44
Author: A U Thor <author@example.com>
Date: Mon Jun 26 00:01:00 2006 +0000

Second

This is the second commit.
---
dir/sub | 2 ++
file0 | 3 +++
Expand Down
Loading

0 comments on commit a40d384

Please sign in to comment.