From: Junio C Hamano <junkio@cox.net>
To: Pavel Roskin <proski@gnu.org>
Cc: git@vger.kernel.org, Martin Langhoff <martin.langhoff@gmail.com>,
Matthias Urlichs <smurf@smurf.noris.de>
Subject: Re: [PATCH] symref support for import scripts
Date: Wed, 16 Nov 2005 11:43:41 -0800 [thread overview]
Message-ID: <7vu0ec7502.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <1132165648.4024.6.camel@dv> (Pavel Roskin's message of "Wed, 16 Nov 2005 13:27:28 -0500")
Pavel Roskin <proski@gnu.org> writes:
> Fix git import script not to assume that .git/HEAD is a symlink.
>
> Signed-off-by: Pavel Roskin <proski@gnu.org>
Thanks.
Martin and Matthias, are these OK with you two? All of the
changes look trivially correct, so I'll take them.
> diff --git a/git-cvsimport.perl b/git-cvsimport.perl
> index 7bd9136..efe1934 100755
> --- a/git-cvsimport.perl
> +++ b/git-cvsimport.perl
> @@ -437,7 +437,11 @@ unless(-d $git_dir) {
> "Either use the correct '-o branch' option,\n".
> "or import to a new repository.\n";
>
> - $last_branch = basename(readlink("$git_dir/HEAD"));
> + open(F, "git-symbolic-ref HEAD |") or
> + die "Cannot run git-symbolic-ref: $!\n";
> + chomp ($last_branch = <F>);
> + $last_branch = basename($last_branch);
> + close(F);
> unless($last_branch) {
> warn "Cannot read the last branch name: $! -- assuming 'master'\n";
> $last_branch = "master";
This part, before or after Pavel's fixes, seems to refuse a
branch named 'topic/#1'. This is not a problem for import
scripts that name their own branches based on what is in the
foreign SCM and flatten their the branch namespaces, but I'd
prefer a comment about the issue somewhere around this code, to
prevent people from copying and pasting the use of "basename()".
There is a corresponding piece in svnimport as well.
next prev parent reply other threads:[~2005-11-16 19:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-16 18:27 [PATCH] symref support for import scripts Pavel Roskin
2005-11-16 19:43 ` Junio C Hamano [this message]
2005-11-16 19:57 ` Matthias Urlichs
2005-11-16 20:26 ` Junio C Hamano
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=7vu0ec7502.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=martin.langhoff@gmail.com \
--cc=proski@gnu.org \
--cc=smurf@smurf.noris.de \
/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).