From fee75457fc45e299c2a962bb9c3949f33f176c02 Mon Sep 17 00:00:00 2001 From: Chris Frey Date: Wed, 24 Sep 2008 19:21:28 -0400 Subject: [PATCH 1/2] Documentation: clarify the details of overriding LESS via core.pager The process of overriding the default LESS options using only git-specific methods is rather obscure. Show the end user how to do it in a step-by-step manner. Signed-off-by: Chris Frey Signed-off-by: Shawn O. Pearce --- Documentation/config.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Documentation/config.txt b/Documentation/config.txt index 3727239891..87b028fbc1 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -363,8 +363,17 @@ core.pager:: variable. Note that git sets the `LESS` environment variable to `FRSX` if it is unset when it runs the pager. One can change these settings by setting the - `LESS` variable to some other value or by giving the - `core.pager` option a value such as "`less -+FRSX`". + `LESS` variable to some other value. Alternately, + these settings can be overridden on a project or + global basis by setting the `core.pager` option. + Setting `core.pager` has no affect on the `LESS` + environment variable behaviour above, so if you want + to override git's default settings this way, you need + to be explicit. For example, to disable the S option + in a backward compatible manner, set `core.pager` + to "`less -+$LESS -FRX`". This will be passed to the + shell by git, which will translate the final command to + "`LESS=FRSX less -+FRSX -FRX`". core.whitespace:: A comma separated list of common whitespace problems to From 41f13af558db1018250ade4d99a51f0b76f65bc8 Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Thu, 25 Sep 2008 22:12:45 +0200 Subject: [PATCH 2/2] Remove empty directories in recursive merge The code was actually supposed to do that, but was accidentally broken. Noticed by Anders Melchiorsen. Signed-off-by: Alex Riesen Signed-off-by: Shawn O. Pearce --- builtin-merge-recursive.c | 4 +--- t/t3030-merge-recursive.sh | 11 +++++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/builtin-merge-recursive.c b/builtin-merge-recursive.c index 43e55bf901..f628a62751 100644 --- a/builtin-merge-recursive.c +++ b/builtin-merge-recursive.c @@ -444,10 +444,8 @@ static int remove_file(int clean, const char *path, int no_wd) return -1; } if (update_working_directory) { - unlink(path); - if (errno != ENOENT || errno != EISDIR) + if (remove_path(path) && errno != ENOENT) return -1; - remove_path(path); } return 0; } diff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh index de0cdb1cf4..0de613dc53 100755 --- a/t/t3030-merge-recursive.sh +++ b/t/t3030-merge-recursive.sh @@ -535,4 +535,15 @@ test_expect_success 'reset and bind merge' ' ' +test_expect_success 'merge removes empty directories' ' + + git reset --hard master && + git checkout -b rm && + git rm d/e && + git commit -mremoved-d/e && + git checkout master && + git merge -s recursive rm && + test_must_fail test -d d +' + test_done