From: Sverre Rabbelier <srabbelier@gmail.com>
To: Gisle Aas <gisle.aas@it.uib.no>
Cc: git@vger.kernel.org, gitster@pobox.com, Gisle Aas <gisle@aas.no>
Subject: Re: [PATCH] Add --path-prefix option to git-fast-import
Date: Tue, 29 Dec 2009 08:06:16 -0600 [thread overview]
Message-ID: <fabb9a1e0912290606ib1f2e46y1ddbae9aa68e5194@mail.gmail.com> (raw)
In-Reply-To: <1262091083-25401-1-git-send-email-gisle.aas@it.uib.no>
Heya,
On Tue, Dec 29, 2009 at 06:51, Gisle Aas <gisle.aas@it.uib.no> wrote:
> +static const char *path_prefix_prepend(struct strbuf *sb, const char *p)
> +{
> + if (p != sb->buf) {
> + strbuf_reset(sb);
> + strbuf_addstr(sb, p);
> + }
> + strbuf_insert(sb, 0, path_prefix, path_prefix_len);
> + return sb->buf;
> +}
> +
> static void file_change_m(struct branch *b)
> {
> const char *p = command_buf.buf + 2;
> @@ -1909,6 +1921,8 @@ static void file_change_m(struct branch *b)
> die("Garbage after path in: %s", command_buf.buf);
> p = uq.buf;
> }
> + if (path_prefix)
> + p = path_prefix_prepend(&uq, p);
You could reduce the size of this change by having path_prefix_prepend
check for path_prefix and just do nothing if it is not set.
--
Cheers,
Sverre Rabbelier
next prev parent reply other threads:[~2009-12-29 14:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-29 12:51 [PATCH] Add --path-prefix option to git-fast-import Gisle Aas
2009-12-29 14:06 ` Sverre Rabbelier [this message]
2009-12-30 8:17 ` Gisle Aas
2009-12-29 15:08 ` Shawn O. Pearce
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=fabb9a1e0912290606ib1f2e46y1ddbae9aa68e5194@mail.gmail.com \
--to=srabbelier@gmail.com \
--cc=gisle.aas@it.uib.no \
--cc=gisle@aas.no \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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).