From c28ded83fc95be8157c851c8be179733a7d4b137 Mon Sep 17 00:00:00 2001 From: Laurent Arnoud Date: Fri, 22 May 2020 12:46:18 +0200 Subject: diff: add config option relative MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `diff.relative` boolean option set to `true` shows only changes in the current directory/value specified by the `path` argument of the `relative` option and shows pathnames relative to the aforementioned directory. Teach `--no-relative` to override earlier `--relative` Add for git-format-patch(1) options documentation `--relative` and `--no-relative` Signed-off-by: Laurent Arnoud Acked-by: Đoàn Trần Công Danh Signed-off-by: Junio C Hamano --- t/t4014-format-patch.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 't/t4014-format-patch.sh') diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index db7e733af9..575e079cc2 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -1602,6 +1602,19 @@ test_expect_success 'format patch ignores color.ui' ' test_cmp expect actual ' +test_expect_success 'format patch respects diff.relative' ' + rm -rf subdir && + mkdir subdir && + echo other content >subdir/file2 && + git add subdir/file2 && + git commit -F msg && + test_unconfig diff.relative && + git format-patch --relative=subdir --stdout -1 >expect && + test_config diff.relative true && + git -C subdir format-patch --stdout -1 >actual && + test_cmp expect actual +' + test_expect_success 'cover letter with invalid --cover-from-description and config' ' test_config branch.rebuild-1.description "config subject -- cgit v1.3-5-g9baa