From: Mike Hommey <mh@glandium.org>
To: git@vger.kernel.org
Cc: Jonathan Nieder <jrnieder@gmail.com>
Subject: [PATCH] fast-import: support the ls command anywhere comments are accepted
Date: Wed, 26 Nov 2014 07:25:39 +0900 [thread overview]
Message-ID: <1416954339-9304-1-git-send-email-mh@glandium.org> (raw)
The git-fast-import manual page says about both cat-blob and ls that they can
be used "anywhere in the stream that comments are accepted", but in practice
it turns out it was only true for cat-blob. This change makes fast-import
behavior match its documentation.
Signed-off-by: Mike Hommey <mh@glandium.org>
---
fast-import.c | 4 ++++
1 file changed, 4 insertions(+)
The downside of this change is that if a script relies on the fixed behavior,
it won't work with older versions of git. I'm not sure it is better than
fixing the documentation to match the unfortunate current limitation?
diff --git a/fast-import.c b/fast-import.c
index d0bd285..7fd59ef 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1910,6 +1910,10 @@ static int read_next_command(void)
parse_cat_blob(p);
continue;
}
+ if (skip_prefix(command_buf.buf, "ls ", &p)) {
+ parse_ls(p, NULL);
+ continue;
+ }
if (command_buf.buf[0] == '#')
continue;
return 0;
--
2.1.1
next reply other threads:[~2014-11-25 22:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-25 22:25 Mike Hommey [this message]
2014-11-25 23:03 ` [PATCH] fast-import: support the ls command anywhere comments are accepted Mike Hommey
2014-11-27 22:01 ` Mike Hommey
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=1416954339-9304-1-git-send-email-mh@glandium.org \
--to=mh@glandium.org \
--cc=git@vger.kernel.org \
--cc=jrnieder@gmail.com \
/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).