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

Re: [PATCH] git-svn: introduce --parents parameter for commands branch and tag

From
Tobias Schulte <tobias.schulte@gliderpilot.de>
Date
May 15, 2013, 19:51 UTC
Message-ID
<5193E74C.6000705@gliderpilot.de>
In-Reply-To
<20130515023547.GA21987@dcvr.yhbt.net>
On 15.05.2013 04:35, Eric Wong wrote:
Show 9 quoted lines
>> +	if (!eval{$ctx->ls($parent, 'HEAD', 0)}) {
>> +		mk_parent_dirs($ctx, $parent);
>> +		print "Creating parent folder ${parent} ...\n";
>> +		$ctx->mkdir($parent)
>> +			unless $_dry_run;
> 
> The newline is confusing, I prefer:
> 
> 		$ctx->mkdir($parent) unless $_dry_run;
In fact, this was a copy/paste from a few lines above
	print "Copying ${src} at r${rev} to ${dst}...\n";
	$ctx->copy($src, $rev, $dst)
		unless $_dry_run;
Show 7 quoted lines
> Howeve :
> 
> 	if (!$_dry_run) {
> 		$ctx->mkdir($parent);
> 	}
> 
> May be preferred, too (especially for the non-Perl-fluent)

I am a non-Perl-fluent, as I come from the Java world with some knowledge of C and C++. But to be able to create the patch I had to gather some Perl knowledge, and by doing this, I learned enough to understand, that there is more than one way, ... Especially the constructs if (condition) foo(); vs foo() if (condition); and the same for unless. And since the dry_run is the exception in this case, I think unless is a valid choice -- and is used often in git-svn.perl. So I will stick to it, but remove the newline.

Show 25 quoted lines
> 
>> +++ b/t/t9167-git-svn-cmd-branch-subproject.sh
> 
>> +test_expect_success 'initialize svnrepo' '
>> +    mkdir import &&
>> +    (
>> +        (cd import &&
>> +        mkdir -p trunk/project branches tags &&
>> +        (cd trunk/project &&
>> +        echo foo > foo
>> +        ) &&
> 
> Tabs for all indentation, and indent consistently for subshells:
> 
> 	mkdir import &&
> 	(
> 		cd import &&
> 		mkdir .. &&
> 		(
> 			cd .. &&
> 			..
> 		)
> 	)
> 
> We use subshells + cd like this so it's easier to read/maintain.

Again, this was a copy/paste from t9128-git-svn-cmd-branch.sh. So this file needs some cosmetics, too. And t9127... as well...

> 
> Thanks again, looking forward to applying v2.
> 
I will send v2 soon.
Tobias
Previous: Eric WongNext: Tobias Schulte
Message 3 of 8 in “git-svn: introduce --parents parameter for commands branch and tag”
  1. git-svn: introduce --parents parameter for commands branch and tagTobias Schulte, May 13, 2013
  2. Eric WongMay 15, 2013
  3. Tobias SchulteMay 15, 2013
  4. git-svn: introduce --parents parameter for commands branch and tagTobias Schulte, May 15, 2013
  5. Eric WongMay 20, 2013
  6. Junio C HamanoMay 20, 2013
  7. Eric WongMay 20, 2013
  8. Junio C HamanoMay 20, 2013

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.