git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
blob 999f2600ded020e9b1799068e40e624eaedbfa00 1195 bytes (raw)
name: t/lib-log-graph.sh 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
 
# Helpers shared by the test scripts for comparing log graphs.

sanitize_output() {
	sed -e 's/ *$//' \
	    -e 's/commit [0-9a-f]*$/commit COMMIT_OBJECT_NAME/' \
	    -e 's/Merge: [ 0-9a-f]*$/Merge: MERGE_PARENTS/' \
	    -e 's/Merge tag.*/Merge HEADS DESCRIPTION/' \
	    -e 's/Merge commit.*/Merge HEADS DESCRIPTION/' \
	    -e 's/, 0 deletions(-)//' \
	    -e 's/, 0 insertions(+)//' \
	    -e 's/ 1 files changed, / 1 file changed, /' \
	    -e 's/, 1 deletions(-)/, 1 deletion(-)/' \
	    -e 's/, 1 insertions(+)/, 1 insertion(+)/' \
	    -e 's/index [0-9a-f]*\.\.[0-9a-f]*/index BEFORE..AFTER/'
}

# Assume expected graph is in file `expect`
test_cmp_graph_file() {
	git log --graph "$@" >output &&
	sanitize_output >output.trimmed <output &&
	test_i18ncmp expect output.trimmed
}

test_cmp_graph() {
	cat >expect &&
	test_cmp_graph_file "$@"
}

# Assume expected graph is in file `expect.colors`
test_cmp_colored_graph_file() {
	git log --graph --color=always "$@" >output.colors.raw &&
	test_decode_color <output.colors.raw | sed "s/ *\$//" >output.colors &&
	test_cmp expect.colors output.colors
}

test_cmp_colored_graph() {
	cat >expect.colors &&
	test_cmp_colored_graph_file "$@"
}

debug log:

solving 999f2600de ...
found 999f2600de in https://public-inbox.org/git/20200216134750.18947-1-abhishekkumar8222@gmail.com/

applying [1/1] https://public-inbox.org/git/20200216134750.18947-1-abhishekkumar8222@gmail.com/
diff --git a/t/lib-log-graph.sh b/t/lib-log-graph.sh
new file mode 100644
index 0000000000..999f2600de

Checking patch t/lib-log-graph.sh...
Applied patch t/lib-log-graph.sh cleanly.

index at:
100644 999f2600ded020e9b1799068e40e624eaedbfa00	t/lib-log-graph.sh

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).