Subject: [PATCH 1/2] Unify `update-index --cacheinfo` usage

From: "Vadim Sannikov via GitGitGadget" <[email-masked]>
Date: Mon, 24 Aug 2020 14:51:42 +0000

From: Vadim Sannikov <[email-masked]>

The old three separate parameters format (`<mode> <object> <path>`)
is replaced with the modern, single-parameter form
(`<mode>,<object>,<path>`).

Different parts of Git code use different syntax, so the commit unifies
it. According to `git-update-index` manual page, the new form is
preferred.

Signed-off-by: Vadim Sannikov <[email-masked]>
---
 git-merge-one-file.sh | 6 +++---
 git-mergetool.sh      | 2 +-
 merge-recursive.c     | 2 +-
 po/bg.po              | 4 ++--
 po/ca.po              | 4 ++--
 po/de.po              | 4 ++--
 po/el.po              | 2 +-
 po/es.po              | 4 ++--
 po/fr.po              | 4 ++--
 po/git.pot            | 2 +-
 po/it.po              | 4 ++--
 po/ko.po              | 4 ++--
 po/ru.po              | 8 ++++++--
 po/sv.po              | 4 ++--
 po/tr.po              | 4 ++--
 po/vi.po              | 4 ++--
 po/zh_CN.po           | 4 ++--
 po/zh_TW.po           | 4 ++--
 18 files changed, 37 insertions(+), 33 deletions(-)

diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh
index f6d9852d2f..5691c4e7ff 100755
--- a/git-merge-one-file.sh
+++ b/git-merge-one-file.sh
@@ -71,7 +71,7 @@ case "${1:-.}${2:-.}${3:-.}" in
 ".$2.")
 	# the other side did not add and we added so there is nothing
 	# to be done, except making the path merged.
-	exec git update-index --add --cacheinfo "$6" "$2" "$4"
+	exec git update-index --add --cacheinfo "$6","$2","$4"
 	;;
 "..$3")
 	echo "Adding $4"
@@ -80,7 +80,7 @@ case "${1:-.}${2:-.}${3:-.}" in
 		echo "ERROR: untracked $4 is overwritten by the merge." >&2
 		exit 1
 	fi
-	git update-index --add --cacheinfo "$7" "$3" "$4" &&
+	git update-index --add --cacheinfo "$7","$3","$4" &&
 		exec git checkout-index -u -f -- "$4"
 	;;
 
@@ -95,7 +95,7 @@ case "${1:-.}${2:-.}${3:-.}" in
 		exit 1
 	fi
 	echo "Adding $4"
-	git update-index --add --cacheinfo "$6" "$2" "$4" &&
+	git update-index --add --cacheinfo "$6","$2","$4" &&
 		exec git checkout-index -u -f -- "$4"
 	;;
 
diff --git a/git-mergetool.sh b/git-mergetool.sh
index e3f6d543fb..ad37b15f4b 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -224,7 +224,7 @@ stage_submodule () {
 	)
 	test -n "$work_rel_path" ||
 	die "fatal: unable to get path of module $path relative to work tree"
-	git update-index --add --replace --cacheinfo 160000 "$submodule_sha1" "${work_rel_path%/}" || die
+	git update-index --add --replace --cacheinfo 160000,"$submodule_sha1","${work_rel_path%/}" || die
 }
 
 checkout_staged_file () {
diff --git a/merge-recursive.c b/merge-recursive.c
index d0214335a7..dfe6f67ec8 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1259,7 +1259,7 @@ static int merge_submodule(struct merge_options *opt,
 		       "If this is correct simply add it to the index "
 		       "for example\n"
 		       "by using:\n\n"
-		       "  git update-index --cacheinfo 160000 %s \"%s\"\n\n"
+		       "  git update-index --cacheinfo 160000,%s,\"%s\"\n\n"
 		       "which will accept this suggestion.\n"),
 		       oid_to_hex(&merges.objects[0].item->oid), path);
 		break;
diff --git a/po/bg.po b/po/bg.po
index a189b16dc4..517c0e6b49 100644
--- a/po/bg.po
+++ b/po/bg.po
@@ -4737,13 +4737,13 @@ msgid ""
 "If this is correct simply add it to the index for example\n"
 "by using:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "which will accept this suggestion.\n"
 msgstr ""
 "Ако това е така, добавете го към индекса с команда като следната:\n"
 "\n"
-"    git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "Това приема предложеното.\n"
 
diff --git a/po/ca.po b/po/ca.po
index c43c21bc22..61c3a7f9b0 100644
--- a/po/ca.po
+++ b/po/ca.po
@@ -4592,12 +4592,12 @@ msgid ""
 "If this is correct simply add it to the index for example\n"
 "by using:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "which will accept this suggestion.\n"
 msgstr ""
 "Si això és correcte simplement afegiu-ho a l'índex per exemple utilitzant "
-"git update-index --cacheinfo 160000 per cents \"%s\" que acceptaran aquest "
+"  git update-index --cacheinfo 160000,%s,\"%s\" que acceptaran aquest "
 "suggeriment.\n"
 
 #: merge-recursive.c:1268
diff --git a/po/de.po b/po/de.po
index 656de24218..ec0106f2b8 100644
--- a/po/de.po
+++ b/po/de.po
@@ -4641,14 +4641,14 @@ msgid ""
 "If this is correct simply add it to the index for example\n"
 "by using:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "which will accept this suggestion.\n"
 msgstr ""
 "Falls das korrekt ist, fügen Sie es einfach der Staging-Area, zum Beispiel "
 "mit:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "hinzu, um diesen Vorschlag zu akzeptieren.\n"
 
diff --git a/po/el.po b/po/el.po
index 703f46d0c7..e775885187 100644
--- a/po/el.po
+++ b/po/el.po
@@ -3075,7 +3075,7 @@ msgid ""
 "If this is correct simply add it to the index for example\n"
 "by using:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "which will accept this suggestion.\n"
 msgstr ""
diff --git a/po/es.po b/po/es.po
index 41a72ca6fb..1c1aeebe47 100644
--- a/po/es.po
+++ b/po/es.po
@@ -4572,14 +4572,14 @@ msgid ""
 "If this is correct simply add it to the index for example\n"
 "by using:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "which will accept this suggestion.\n"
 msgstr ""
 "Si esto es correcto simplemente agrégalo al índice por ejemplo\n"
 "usando:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "el cual aceptará esta sugerencia.\n"
 
diff --git a/po/fr.po b/po/fr.po
index d20fc440ab..157c41ff4c 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -4714,14 +4714,14 @@ msgid ""
 "If this is correct simply add it to the index for example\n"
 "by using:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "which will accept this suggestion.\n"
 msgstr ""
 "Si c'est correct, ajoutez le simplement à l'index\n"
 "en utilisant par exemple :\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "qui acceptera cette suggestion.\n"
 
diff --git a/po/git.pot b/po/git.pot
index 198b6e0a4a..2d50bebf5a 100644
--- a/po/git.pot
+++ b/po/git.pot
@@ -4256,7 +4256,7 @@ msgid ""
 "If this is correct simply add it to the index for example\n"
 "by using:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "which will accept this suggestion.\n"
 msgstr ""
diff --git a/po/it.po b/po/it.po
index 53523e76df..c8264dd7bc 100644
--- a/po/it.po
+++ b/po/it.po
@@ -4649,14 +4649,14 @@ msgid ""
 "If this is correct simply add it to the index for example\n"
 "by using:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "which will accept this suggestion.\n"
 msgstr ""
 "Se è corretta aggiungila semplicemente all'indice, ad esempio\n"
 "usando:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "per accettare questo suggerimento.\n"
 
diff --git a/po/ko.po b/po/ko.po
index dcfe21c223..47b611edee 100644
--- a/po/ko.po
+++ b/po/ko.po
@@ -2361,14 +2361,14 @@ msgid ""
 "If this is correct simply add it to the index for example\n"
 "by using:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "which will accept this suggestion.\n"
 msgstr ""
 "이 제안이 맞으면 인덱스에 추가하면 됩니다. 예를 들어\n"
 "다음 명령을 사용하면:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "제안을 받아들이게 됩니다.\n"
 
diff --git a/po/ru.po b/po/ru.po
index a77b462e62..a928cd879e 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -3523,10 +3523,14 @@ msgid ""
 "If this is correct simply add it to the index for example\n"
 "by using:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "which will accept this suggestion.\n"
-msgstr "Если оно верное, то просто добавьте его в индекс, например так:\n\n  git update-index --cacheinfo 160000 %s \"%s\"\n\nтем самым принимая это предположение.\n"
+msgstr "Если оно верное, то просто добавьте его в индекс, например так:\n"
+"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
+"\n"
+"тем самым принимая это предположение.\n"
 
 #: merge-recursive.c:1252
 #, c-format
diff --git a/po/sv.po b/po/sv.po
index 93f3c6f3f7..f5a850f0b7 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -4551,14 +4551,14 @@ msgid ""
 "If this is correct simply add it to the index for example\n"
 "by using:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "which will accept this suggestion.\n"
 msgstr ""
 "Om detta är riktigt lägger du bara till det i indexet, till\n"
 "exempel så här:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "vilket godtar lösningen.\n"
 
diff --git a/po/tr.po b/po/tr.po
index 9a17c19b25..af5f9ba7f8 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -4619,13 +4619,13 @@ msgid ""
 "If this is correct simply add it to the index for example\n"
 "by using:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "which will accept this suggestion.\n"
 msgstr ""
 "Eğer bu doğruysa yalnızca indekse ekleyin, örneğinbu öneriyi kabul edecek:\n"
 "\n"
-"\tgit update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "komutunu kullanmanız yeterlidir.\n"
 
diff --git a/po/vi.po b/po/vi.po
index d730cf1141..beec050125 100644
--- a/po/vi.po
+++ b/po/vi.po
@@ -4548,14 +4548,14 @@ msgid ""
 "If this is correct simply add it to the index for example\n"
 "by using:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "which will accept this suggestion.\n"
 msgstr ""
 "Nếu đây là đúng đơn giản thêm nó vào mục lục ví dụ\n"
 "bằng cách dùng:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "cái mà sẽ chấp nhận gợi ý này.\n"
 
diff --git a/po/zh_CN.po b/po/zh_CN.po
index a531819623..69dd29140b 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -4567,13 +4567,13 @@ msgid ""
 "If this is correct simply add it to the index for example\n"
 "by using:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "which will accept this suggestion.\n"
 msgstr ""
 "如果这个正确，将其添加到索引，例如使用命令：\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "以接受此建议。\n"
 
diff --git a/po/zh_TW.po b/po/zh_TW.po
index 9334b46faa..18e6b8985a 100644
--- a/po/zh_TW.po
+++ b/po/zh_TW.po
@@ -4692,13 +4692,13 @@ msgid ""
 "If this is correct simply add it to the index for example\n"
 "by using:\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "which will accept this suggestion.\n"
 msgstr ""
 "如果這個正確，將其新增到索引，例如使用指令：\n"
 "\n"
-"  git update-index --cacheinfo 160000 %s \"%s\"\n"
+"  git update-index --cacheinfo 160000,%s,\"%s\"\n"
 "\n"
 "以接受此建議。\n"
 
-- 
gitgitgadget