git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-svn: allow to specify svn branch for commands

From
EWEric Wong <normalperson@yhbt.net>
Date
Jun 5, 2007, 04:14 UTC
Message-ID
<20070605041446.GA4266@untitled>
In-Reply-To
<1181014957993-git-send-email-sam.vilain@catalyst.net.nz>
Sam Vilain <sam.vilain@catalyst.net.nz> wrote:
> "git-svn dcommit" ends up making an arbitrary decision when pushing
> back merges.  Allow the user to specify which one is used, albeit in a
> rather hack-ish way.

Frightening... Perhaps we should echo the final URL out to the user and prompt them for confirmation.

Show 24 quoted lines
> ---
>  Documentation/git-svn.txt |   11 +++++++++++
>  git-svn.perl              |   16 +++++++++-------
>  2 files changed, 20 insertions(+), 7 deletions(-)
> 
> diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
> index c0d7d95..3e64522 100644
> --- a/Documentation/git-svn.txt
> +++ b/Documentation/git-svn.txt
> @@ -69,6 +69,17 @@ COMMANDS
>  	argument if that is what you want.  This is useful if
>  	you wish to track multiple projects that share a common
>  	repository.
> +-B<svn_branch>;;
> +--branch=<svn_branch>;;
> +	Normally, git-svn is capable of figuring out which branch you
> +	are working on.  However, if you are doing merges between svn
> +	branches using git then the decision about which branch to
> +	dcommit to will end up being made based on which of the
> +	branches you are merging has the newest upstream commit.  This
> +	option enables a global filter that tells git-svn what to look
> +	for in the git-svn-id: line - specify a repository UUID or a
> +	branch name here.  So, it may be used with "git-svn log",
> +	"git-svn dcommit", etc.

This should clarify that a Perl regular expression is used. '.' can match '-' or '_' which is also pretty common in version numbers. Perhaps give an -F(ixed-string) option like grep does?

Show 9 quoted lines
>  sub working_head_info {
> -	my ($head, $refs) = @_;
> +	my ($head, $refs, $grep) = @_;
>  	my ($fh, $ctx) = command_output_pipe('rev-list', $head);
>  	while (my $hash = <$fh>) {
>  		chomp($hash);
>  		my ($url, $rev, $uuid) = cmt_metadata($hash);
> +		next unless (!$grep or $url =~ m{$grep} or $uuid =~ m{$grep});
> @@ -3394,7 +3396,7 @@ sub git_svn_log_cmd {
-- 
Eric Wong
Previous: Sam VilainNext: Sam Vilain
Message 2 of 6 in “git-svn: allow to specify svn branch for commands”
  1. git-svn: allow to specify svn branch for commandsSam Vilain, Jun 5, 2007
  2. Eric WongJun 5, 2007
  3. Sam VilainJun 5, 2007
  4. Eric WongJun 5, 2007
  5. Stephen TousetJun 5, 2007
  6. Eric WongJun 5, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.