From 16758621d5a4a78eed7c183b60bf7ebaeaf305c5 Mon Sep 17 00:00:00 2001 From: Bert Wesarg Date: Tue, 23 Feb 2010 21:11:12 +0100 Subject: Documentation: mention conflict marker size argument (%L) for merge driver 23a64c9e (conflict-marker-size: new attribute, 2010-01-16) introduced the new attribute and also pass the conflict marker size as %L to merge driver commands. This documents the substitution. Signed-off-by: Bert Wesarg Signed-off-by: Junio C Hamano diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt index b396a87..d892e64 100644 --- a/Documentation/gitattributes.txt +++ b/Documentation/gitattributes.txt @@ -511,7 +511,8 @@ command to run to merge ancestor's version (`%O`), current version (`%A`) and the other branches' version (`%B`). These three tokens are replaced with the names of temporary files that hold the contents of these versions when the command line is -built. +built. Additionally, %L will be replaced with the conflict marker +size (see below). The merge driver is expected to leave the result of the merge in the file named with `%A` by overwriting it, and exit with zero -- cgit v0.10.2-6-g49f6 From 689b8c290db9d5880699dd3538134daffc1c55d0 Mon Sep 17 00:00:00 2001 From: Bert Wesarg Date: Tue, 23 Feb 2010 21:11:53 +0100 Subject: rerere: fix memory leak if rerere images can't be read Signed-off-by: Bert Wesarg Signed-off-by: Junio C Hamano diff --git a/rerere.c b/rerere.c index d1d3e75..a59f74f 100644 --- a/rerere.c +++ b/rerere.c @@ -364,7 +364,7 @@ static int find_conflict(struct string_list *conflict) static int merge(const char *name, const char *path) { int ret; - mmfile_t cur, base, other; + mmfile_t cur = {NULL, 0}, base = {NULL, 0}, other = {NULL, 0}; mmbuffer_t result = {NULL, 0}; if (handle_file(path, NULL, rerere_path(name, "thisimage")) < 0) @@ -372,8 +372,10 @@ static int merge(const char *name, const char *path) if (read_mmfile(&cur, rerere_path(name, "thisimage")) || read_mmfile(&base, rerere_path(name, "preimage")) || - read_mmfile(&other, rerere_path(name, "postimage"))) - return 1; + read_mmfile(&other, rerere_path(name, "postimage"))) { + ret = 1; + goto out; + } ret = ll_merge(&result, path, &base, &cur, "", &other, "", 0); if (!ret) { FILE *f = fopen(path, "w"); @@ -387,6 +389,7 @@ static int merge(const char *name, const char *path) strerror(errno)); } +out: free(cur.ptr); free(base.ptr); free(other.ptr); -- cgit v0.10.2-6-g49f6 From 29b67543d3060a08bee601dbad91dd400e833052 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Mon, 22 Feb 2010 08:35:46 -0600 Subject: am: remove rebase-apply directory before gc When git am does an automatic gc it doesn't clean up the rebase-apply directory until after this has finished. This means that if the user aborts the gc then future am or rebase operations will report that an existing operation is in progress, which is undesirable and confusing. Reported by Mark Brown through http://bugs.debian.org/570966 Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano diff --git a/git-am.sh b/git-am.sh index 3c08d53..ebfbee5 100755 --- a/git-am.sh +++ b/git-am.sh @@ -776,6 +776,5 @@ do go_next done -git gc --auto - rm -fr "$dotest" +git gc --auto -- cgit v0.10.2-6-g49f6