Skip to content

Commit 47979d5

Browse files
author
Junio C Hamano
committed
t4013: add more tests around -c and --cc
Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 3c2f75b commit 47979d5

18 files changed

+1263
-3
lines changed

t/t4013-diff-various.sh

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,34 @@ diff-tree -p -m master
163163
diff-tree -c master
164164
diff-tree -c --abbrev master
165165
diff-tree --cc master
166+
# stat only should show the diffstat with the first parent
167+
diff-tree -c --stat master
168+
diff-tree --cc --stat master
169+
diff-tree -c --stat --summary master
170+
diff-tree --cc --stat --summary master
171+
# stat summary should show the diffstat and summary with the first parent
172+
diff-tree -c --stat --summary side
173+
diff-tree --cc --stat --summary side
174+
# this one gives an extra newline after stat, which should be removed
175+
# diff-tree --cc --patch-with-stat master
176+
# this one gives an extra newline after stat, which should be removed
177+
# other than that it shows the correct example -- stat and summary are
178+
# against the first parent, and patch-looking combined diff follows.
179+
diff-tree --cc --patch-with-stat --summary master
180+
# this is correct
181+
diff-tree --cc --patch-with-stat --summary side
166182
167183
log master
168184
log -p master
169185
log --root master
170186
log --root -p master
171187
log --patch-with-stat master
172188
log --root --patch-with-stat master
173-
#log --root --patch-with-stat --summary master
189+
log --root --patch-with-stat --summary master
190+
log --root -c --patch-with-stat --summary master
191+
log --root --cc --patch-with-stat --summary master
174192
log -SF master
193+
log -SF -p master
175194
176195
whatchanged master
177196
whatchanged -p master
@@ -180,10 +199,15 @@ whatchanged --root -p master
180199
whatchanged --patch-with-stat master
181200
whatchanged --root --patch-with-stat master
182201
whatchanged --root --patch-with-stat --summary master
202+
whatchanged --root -c --patch-with-stat --summary master
203+
whatchanged --root --cc --patch-with-stat --summary master
183204
whatchanged -SF master
205+
whatchanged -SF -p master
184206
185207
log --patch-with-stat master -- dir/
186208
whatchanged --patch-with-stat master -- dir/
209+
log --patch-with-stat --summary master -- dir/
210+
whatchanged --patch-with-stat --summary master -- dir/
187211
188212
show initial
189213
show --root initial
@@ -195,8 +219,6 @@ show --patch-with-stat side
195219
show --patch-with-raw side
196220
show --patch-with-stat --summary side
197221
198-
199-
200222
EOF
201223

202224
test_done
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
$ git diff-tree --cc --patch-with-stat --summary master
2+
176b998f5d647cbd77a9d8acf4531e930754d16d
3+
dir/sub | 2 ++
4+
file0 | 3 +++
5+
2 files changed, 5 insertions(+), 0 deletions(-)
6+
7+
8+
diff --cc dir/sub
9+
index cead32e,7289e35..992913c
10+
--- a/dir/sub
11+
+++ b/dir/sub
12+
@@@ -1,6 -1,4 +1,8 @@@
13+
A
14+
B
15+
+C
16+
+D
17+
+E
18+
+F
19+
+ 1
20+
+ 2
21+
diff --cc file0
22+
index b414108,f4615da..10a8a9f
23+
--- a/file0
24+
+++ b/file0
25+
@@@ -1,6 -1,6 +1,9 @@@
26+
1
27+
2
28+
3
29+
+4
30+
+5
31+
+6
32+
+ A
33+
+ B
34+
+ C
35+
$
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
$ git diff-tree --cc --patch-with-stat --summary side
2+
c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
3+
dir/sub | 2 ++
4+
file0 | 3 +++
5+
file3 | 4 ++++
6+
3 files changed, 9 insertions(+), 0 deletions(-)
7+
create mode 100644 file3
8+
9+
diff --git a/dir/sub b/dir/sub
10+
index 35d242b..7289e35 100644
11+
--- a/dir/sub
12+
+++ b/dir/sub
13+
@@ -1,2 +1,4 @@
14+
A
15+
B
16+
+1
17+
+2
18+
diff --git a/file0 b/file0
19+
index 01e79c3..f4615da 100644
20+
--- a/file0
21+
+++ b/file0
22+
@@ -1,3 +1,6 @@
23+
1
24+
2
25+
3
26+
+A
27+
+B
28+
+C
29+
diff --git a/file3 b/file3
30+
new file mode 100644
31+
index 0000000..7289e35
32+
--- /dev/null
33+
+++ b/file3
34+
@@ -0,0 +1,4 @@
35+
+A
36+
+B
37+
+1
38+
+2
39+
$
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
$ git diff-tree --cc --stat --summary master
2+
176b998f5d647cbd77a9d8acf4531e930754d16d
3+
dir/sub | 2 ++
4+
file0 | 3 +++
5+
2 files changed, 5 insertions(+), 0 deletions(-)
6+
$
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
$ git diff-tree --cc --stat --summary side
2+
c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
3+
dir/sub | 2 ++
4+
file0 | 3 +++
5+
file3 | 4 ++++
6+
3 files changed, 9 insertions(+), 0 deletions(-)
7+
create mode 100644 file3
8+
$
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
$ git diff-tree --cc --stat master
2+
176b998f5d647cbd77a9d8acf4531e930754d16d
3+
dir/sub | 2 ++
4+
file0 | 3 +++
5+
2 files changed, 5 insertions(+), 0 deletions(-)
6+
$
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
$ git diff-tree -c --stat --summary master
2+
176b998f5d647cbd77a9d8acf4531e930754d16d
3+
dir/sub | 2 ++
4+
file0 | 3 +++
5+
2 files changed, 5 insertions(+), 0 deletions(-)
6+
$
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
$ git diff-tree -c --stat --summary side
2+
c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
3+
dir/sub | 2 ++
4+
file0 | 3 +++
5+
file3 | 4 ++++
6+
3 files changed, 9 insertions(+), 0 deletions(-)
7+
create mode 100644 file3
8+
$
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
$ git diff-tree -c --stat master
2+
176b998f5d647cbd77a9d8acf4531e930754d16d
3+
dir/sub | 2 ++
4+
file0 | 3 +++
5+
2 files changed, 5 insertions(+), 0 deletions(-)
6+
$
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
$ git log --patch-with-stat --summary master -- dir/
2+
commit 176b998f5d647cbd77a9d8acf4531e930754d16d
3+
Merge: 889b315... c7a2ab9...
4+
Author: A U Thor <author@example.com>
5+
Date: Mon Jun 26 00:04:00 2006 +0000
6+
7+
Merge branch 'side'
8+
9+
commit c7a2ab9e8eac7b117442a607d5a9b3950ae34d5a
10+
Author: A U Thor <author@example.com>
11+
Date: Mon Jun 26 00:03:00 2006 +0000
12+
13+
Side
14+
---
15+
dir/sub | 2 ++
16+
1 files changed, 2 insertions(+), 0 deletions(-)
17+
18+
diff --git a/dir/sub b/dir/sub
19+
index 35d242b..7289e35 100644
20+
--- a/dir/sub
21+
+++ b/dir/sub
22+
@@ -1,2 +1,4 @@
23+
A
24+
B
25+
+1
26+
+2
27+
28+
commit 889b315013ef9f2e2f90aa0b054b267c8a557847
29+
Author: A U Thor <author@example.com>
30+
Date: Mon Jun 26 00:02:00 2006 +0000
31+
32+
Third
33+
---
34+
dir/sub | 2 ++
35+
1 files changed, 2 insertions(+), 0 deletions(-)
36+
37+
diff --git a/dir/sub b/dir/sub
38+
index 8422d40..cead32e 100644
39+
--- a/dir/sub
40+
+++ b/dir/sub
41+
@@ -2,3 +2,5 @@ A
42+
B
43+
C
44+
D
45+
+E
46+
+F
47+
48+
commit 7952a93e09bf565b5592766a438b40cd81f4846f
49+
Author: A U Thor <author@example.com>
50+
Date: Mon Jun 26 00:01:00 2006 +0000
51+
52+
Second
53+
---
54+
dir/sub | 2 ++
55+
1 files changed, 2 insertions(+), 0 deletions(-)
56+
57+
diff --git a/dir/sub b/dir/sub
58+
index 35d242b..8422d40 100644
59+
--- a/dir/sub
60+
+++ b/dir/sub
61+
@@ -1,2 +1,4 @@
62+
A
63+
B
64+
+C
65+
+D
66+
67+
commit 444ac553ac7612cc88969031b02b3767fb8a353a
68+
Author: A U Thor <author@example.com>
69+
Date: Mon Jun 26 00:00:00 2006 +0000
70+
71+
Initial
72+
$

0 commit comments

Comments
 (0)