path: root/Documentation/git-update-index.txt
diff options
authorJunio C Hamano <>2014-03-23 23:57:28 (GMT)
committerJunio C Hamano <>2014-03-24 17:43:35 (GMT)
commitec160ae12b0ae938ed5076b9f604e88976fc429c (patch)
tree5749b77dfdf7087398c2e9545a75b3779a2a4fb7 /Documentation/git-update-index.txt
parente703d7118c68bb5b1f850dae4060609a88500b18 (diff)
update-index: teach --cacheinfo a new syntax "mode,sha1,path"
The "--cacheinfo" option is unusual in that it takes three option parameters. An option with an optional parameter is bad enough. An option with multiple parameters is simply insane. Introduce a new syntax that takes these three things concatenated together with a comma, which makes the command line syntax more uniform across subcommands, while retaining the traditional syntax for backward compatiblity. If we were designing the "update-index" subcommand from scratch today, it may probably have made sense to make this option (and possibly others) a command mode option that does not take any option parameter (hence no need for arg-help). But we do not live in such an ideal world, and as far as I can tell, the command still supports (and must support) mixed command modes in a single invocation, e.g. $ git update-index path1 --add path2 \ --cacheinfo 100644 $(git hash-object --stdin -w <path3) path3 \ path4 must make sure path1 is already in the index and update all of these four paths. So this is probably as far as we can go to fix this issue without risking to break people's existing scripts. Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'Documentation/git-update-index.txt')
1 files changed, 6 insertions, 2 deletions
diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
index e0a8702..d6de4a0 100644
--- a/Documentation/git-update-index.txt
+++ b/Documentation/git-update-index.txt
@@ -12,7 +12,7 @@ SYNOPSIS
'git update-index'
[--add] [--remove | --force-remove] [--replace]
[--refresh] [-q] [--unmerged] [--ignore-missing]
- [(--cacheinfo <mode> <object> <file>)...]
+ [(--cacheinfo <mode>,<object>,<file>)...]
@@ -68,8 +68,12 @@ OPTIONS
Ignores missing files during a --refresh
+--cacheinfo <mode>,<object>,<path>::
--cacheinfo <mode> <object> <path>::
- Directly insert the specified info into the index.
+ Directly insert the specified info into the index. For
+ backward compatibility, you can also give these three
+ arguments as three separate parameters, but new users are
+ encouraged to use a single-parameter form.
Read index information from stdin.