summaryrefslogtreecommitdiff
path: root/parse-options.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-08-06 18:43:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-08-06 20:38:18 (GMT)
commitdbd0f5c7692cce0c5fea535a06622b3a93df9598 (patch)
tree92606e8799f9f518296ef4e9124cf782d7e234f2 /parse-options.h
parenteabbc99a2198d1cae62ce951457e7edc23b5f1a9 (diff)
downloadgit-dbd0f5c7692cce0c5fea535a06622b3a93df9598.zip
git-dbd0f5c7692cce0c5fea535a06622b3a93df9598.tar.gz
git-dbd0f5c7692cce0c5fea535a06622b3a93df9598.tar.bz2
Files given on the command line are relative to $cwd
When running "git commit -F file" and "git tag -F file" from a subdirectory, we should take it as relative to the directory we started from, not relative to the top-level directory. This adds a helper function "parse_options_fix_filename()" to make it more convenient to fix this class of issues. Ideally, parse_options() should support a new type of option, "OPT_FILENAME", to do this uniformly, but this patch is meant to go to 'maint' to fix it minimally. One thing to note is that value for "commit template file" that comes from the command line is taken as relative to $cwd just like other parameters, but when it comes from the configuration varilable 'commit.template', it is taken as relative to the working tree root as before. I think this difference actually is sensible (not that I particularly think commit.template itself is sensible). Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'parse-options.h')
-rw-r--r--parse-options.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/parse-options.h b/parse-options.h
index 4ee443d..13ad158 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -123,4 +123,6 @@ extern int parse_opt_approxidate_cb(const struct option *, const char *, int);
"use <n> digits to display SHA-1s", \
PARSE_OPT_OPTARG, &parse_opt_abbrev_cb, 0 }
+extern const char *parse_options_fix_filename(const char *prefix, const char *file);
+
#endif