From: Dmitry Ivankov <divanorama@gmail.com>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
Jonathan Nieder <jrnieder@gmail.com>,
Ramkumar Ramachandra <artagnon@gmail.com>,
Johan Herland <johan@herland.net>,
"Shawn O. Pearce" <spearce@spearce.org>,
Dmitry Ivankov <divanorama@gmail.com>
Subject: [PATCH 2/3] doc/fast-import: document feature import-marks-if-exists
Date: Tue, 12 Jul 2011 21:10:27 +0600 [thread overview]
Message-ID: <1310483428-29833-3-git-send-email-divanorama@gmail.com> (raw)
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
next prev parent reply other threads:[~2011-07-12 15:10 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-12 15:10 [PATCH 0/3] doc/{fast-import,remote-helpers}: few clarifications Dmitry Ivankov
2011-07-12 15:10 ` [PATCH 1/3] doc/fast-import: clarify notemodify command Dmitry Ivankov
2011-07-12 15:10 ` Dmitry Ivankov [this message]
2011-07-12 17:00 ` [PATCH 2/3] doc/fast-import: document feature import-marks-if-exists Junio C Hamano
2011-07-13 10:27 ` Ramkumar Ramachandra
2011-07-12 15:10 ` [PATCH 3/3] doc/remote-helpers: document the gitdir feature Dmitry Ivankov
2011-07-13 12:04 ` Sverre Rabbelier
2011-07-13 17:10 ` [PATCH v2 1/3] doc/fast-import: clarify notemodify command Dmitry Ivankov
2011-07-22 19:32 ` Johan Herland
2011-07-13 17:10 ` [PATCH v2 2/3] doc/fast-import: document feature import-marks-if-exists Dmitry Ivankov
2011-07-13 17:10 ` [PATCH v2 3/3] remote-helpers: export GIT_DIR variable to helpers Dmitry Ivankov
2011-07-13 17:14 ` Dmitry Ivankov
2011-07-13 17:36 ` Sverre Rabbelier
2011-07-13 18:10 ` Dmitry Ivankov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1310483428-29833-3-git-send-email-divanorama@gmail.com \
--to=divanorama@gmail.com \
--cc=artagnon@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=johan@herland.net \
--cc=jrnieder@gmail.com \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).