From: Duy Nguyen <pclouds@gmail.com>
To: Eric Wong <e@80x24.org>
Cc: Mathieu Arnold <mat@freebsd.org>,
Stefan Beller <sbeller@google.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: problem with git worktree and git svn
Date: Thu, 13 Oct 2016 17:29:27 +0700 [thread overview]
Message-ID: <CACsJy8ADmHLW5ba4bVTGN9ccqpMDNFgkqE_5JvnqZ0BxWcaCvw@mail.gmail.com> (raw)
In-Reply-To: <20161013015233.GA18001@whir>
On Thu, Oct 13, 2016 at 8:52 AM, Eric Wong <e@80x24.org> wrote:
> +sub svn_dir {
> + my $git_dir = scalar @_ ? $_[0] : $ENV{GIT_DIR};
> + my $common = $ENV{GIT_COMMON_DIR} || "$git_dir/commondir";
> + $git_dir .= '/'.::file_to_s($common) if -e $common;
> + my $svn_dir = $git_dir . '/svn';
> + $svn_dir =~ tr!/!/!s;
> + $svn_dir;
> +}
If this is shell script, this function could be just
svn_dir() {
git rev-parse --git-path svn
}
which should give you correct path in either single or multi-worktree
context and you don't need to bother with details like
$GIT_COMMON_DIR. But I don't know how Perl bindings are implemented, I
don't know if we have something similar (or easy to add it, like
Git::git_path()).
I don't know much about git-svn, but from the look of it I agree
replacing $ENV{GIT_DIR}/svn with svn_dir() should fix it, assuming
that you don't hard code $ENV{GIT_DIR}/blahblah somewhere else. I
don't see any other potential problems (from multi-worktree
perspective).
--
Duy
next prev parent reply other threads:[~2016-10-13 10:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-12 14:45 problem with git worktree and git svn Mathieu Arnold
2016-10-12 21:05 ` Stefan Beller
2016-10-13 1:52 ` Eric Wong
2016-10-13 10:29 ` Duy Nguyen [this message]
2016-10-13 20:55 ` Eric Wong
2016-10-14 1:46 ` [PATCH 0/2] git-svn: implement "git worktree" awareness Eric Wong
2016-10-14 1:46 ` [PATCH 1/2] git-svn: reduce scope of input record separator change Eric Wong
2016-10-14 1:46 ` [PATCH 2/2] git-svn: "git worktree" awareness Eric Wong
2016-10-26 20:02 ` [PATCH 0/2] git-svn: implement " Eric Wong
2016-10-26 21:17 ` 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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACsJy8ADmHLW5ba4bVTGN9ccqpMDNFgkqE_5JvnqZ0BxWcaCvw@mail.gmail.com \
--to=pclouds@gmail.com \
--cc=e@80x24.org \
--cc=git@vger.kernel.org \
--cc=mat@freebsd.org \
--cc=sbeller@google.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).