aboutsummaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-02-13 00:34:39 -0800
committerJunio C Hamano <gitster@pobox.com>2008-02-13 14:59:34 -0800
commitc0cb4a067972700f0682fbab13768bcc7dc7a3c3 (patch)
treecd372148a53a828f4beeff6f395dc3c87fab3698 /diff.c
parentcd676a513672eeb9663c6d4de276a1c860a4b879 (diff)
downloadgit-c0cb4a067972700f0682fbab13768bcc7dc7a3c3.tar.gz
git-c0cb4a067972700f0682fbab13768bcc7dc7a3c3.tar.xz
diff --relative: help working in a bare repository
This allows the --relative option to say which subdirectory to pretend to be in, so that in a bare repository, you can say: $ git log --relative=drivers/ v2.6.20..v2.6.22 -- drivers/scsi/ Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/diff.c b/diff.c
index db4bd557b..2b89b1600 100644
--- a/diff.c
+++ b/diff.c
@@ -2302,6 +2302,10 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
options->detect_rename = 0;
else if (!strcmp(arg, "--relative"))
DIFF_OPT_SET(options, RELATIVE_NAME);
+ else if (!prefixcmp(arg, "--relative=")) {
+ DIFF_OPT_SET(options, RELATIVE_NAME);
+ options->prefix = arg + 11;
+ }
/* xdiff options */
else if (!strcmp(arg, "-w") || !strcmp(arg, "--ignore-all-space"))