git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/3] doc/fast-import: document feature import-marks-if-exists

From
Dmitry Ivankov <divanorama@gmail.com>
Date
Jul 12, 2011, 15:10 UTC
Message-ID
<1310483428-29833-3-git-send-email-divanorama@gmail.com>
In-Reply-To
<1310483428-29833-1-git-send-email-divanorama@gmail.com>

fast-import parameter --import-marks-if-exists was introduced in commit dded4.. --import-marks can be set via a "feature" command in a fast-import stream and --import-marks-if-exists has support for such specification too, for free.

Document "feature import-marks-if-exists=<file>" command and add a minimalistic test for it.

Signed-off-by: Dmitry Ivankov <divanorama@gmail.com>
---
 Documentation/git-fast-import.txt |    5 +++++
 t/t9300-fast-import.sh            |   15 +++++++++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt
index 3f5b912..bdcc81c 100644
--- a/Documentation/git-fast-import.txt
+++ b/Documentation/git-fast-import.txt
@@ -1005,6 +1005,11 @@ import-marks::
 	second, an --import-marks= command-line option overrides
 	any "feature import-marks" command in the stream.
 
+import-marks-if-exists::
+	Like import-marks but instead of erroring out, silently
+	skips the file if it does not exist. Differences from --
+	version are the same as with import-marks feature above.
+
 cat-blob::
 ls::
 	Require that the backend support the 'cat-blob' or 'ls' command.
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 2a53640..eed57df 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -1882,6 +1882,21 @@ test_expect_success 'R: --import-marks-if-exists' '
 	test_cmp expect io.marks
 '
 
+test_expect_success 'R: feature import-marks-if-exists' '
+	rm -f io.marks &&
+	blob=$(echo hi | git hash-object --stdin) &&
+	echo ":1 $blob" >expect &&
+	git fast-import --import-marks-if-exists=io.marks --export-marks=io.marks <<-\EOF &&
+	feature import-marks-if-exists=io.marks
+	blob
+	mark :1
+	data 3
+	hi
+
+	EOF
+	test_cmp expect io.marks
+'
+
 cat >input << EOF
 feature import-marks=marks.out
 feature export-marks=marks.new
-- 
1.7.3.4
Previous: Dmitry IvankovNext: Junio C Hamano
Message 3 of 14 in “doc/{fast-import,remote-helpers}: few clarifications”
  1. 0/3 doc/{fast-import,remote-helpers}: few clarificationsDmitry Ivankov, Jul 12, 2011
  2. 1/3 doc/fast-import: clarify notemodify commandDmitry Ivankov, Jul 12, 2011
  3. 2/3 doc/fast-import: document feature import-marks-if-existsDmitry Ivankov, Jul 12, 2011
  4. Junio C HamanoJul 12, 2011
  5. Ramkumar RamachandraJul 13, 2011
  6. 3/3 doc/remote-helpers: document the gitdir featureDmitry Ivankov, Jul 12, 2011
  7. Sverre RabbelierJul 13, 2011
  8. 1/3 doc/fast-import: clarify notemodify commandDmitry Ivankov, Jul 13, 2011
  9. Johan HerlandJul 22, 2011
  10. 2/3 doc/fast-import: document feature import-marks-if-existsDmitry Ivankov, Jul 13, 2011
  11. 3/3 remote-helpers: export GIT_DIR variable to helpersDmitry Ivankov, Jul 13, 2011
  12. Dmitry IvankovJul 13, 2011
  13. Sverre RabbelierJul 13, 2011
  14. Dmitry IvankovJul 13, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.