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

Re: [PATCH 1/2] git-svn: ignore changeless commits when checking for a cherry-pick

From
Andrew Myrick <amyrick@apple.com>
Date
Jan 6, 2010, 22:52 UTC
Message-ID
<E10FB265-0C47-44C7-9347-687A9F447603@apple.com>
In-Reply-To
<20100106214338.GA5115@dcvr.yhbt.net>
On Jan 6, 2010, at 1:43 PM, Eric Wong wrote:
Show 15 quoted lines
> Andrew Myrick <amyrick@apple.com> wrote:
>> diff --git a/git-svn.perl b/git-svn.perl
>> index 650c9e5..8c7c034 100755
>> --- a/git-svn.perl
>> +++ b/git-svn.perl
>> @@ -3052,12 +3052,36 @@ sub check_cherry_pick {
>> 	for my $range ( @ranges ) {
>> 		delete @commits{_rev_list($range)};
>> 	}
>> +        for my $commit (keys %commits) {
> 
> Hi Andrew,
> 
> I'll again defer to Sam for Acks on these.  Test cases would be nice to
> have, too.
I'll see what I can do.  The test cases are conceptually simple (the svn dump I sent out the other day will exercise one of these patches), but it will take me some time to learn git's testing infrastructure, and I have impending deadlines on other work, so I can't promise anything immediate.
Show 20 quoted lines
> 
> A few notes:
> 
> The prevailing standard for indentation in git is with hard tabs and
> that's certainly the case with the rest of git-svn.perl.
> 
>> +sub has_no_changes {
>> +        my $commit = shift;
>> +
>> +        my @revs = split / /, command_oneline(
>> +                qw(rev-list --parents -1 -m), $commit);
>> +
>> +        # Commits with no parents, e.g. the start of a partial branch,
>> +        # have changes by definition.
>> +        return 1 if (@revs < 2);
>> +    
> 
> I've become very picky about trailing whitespace (from Junio :), too.
> "git diff --check" is helpful for this, especially in the pre-commit
> hook.
My apologies for not noticing this.  I'll regenerate patches that conform to the style guidelines.  Thanks for pointing out `git diff --check`; it's quite helpful.
-Andrew
Previous: Sam VilainNext: Andrew Myrick
Message 7 of 11 in “git-svn: ignore changeless commits when checking for a cherry-pick”
  1. 1/2 git-svn: ignore changeless commits when checking for a cherry-pickAndrew Myrick, Jan 6, 2010
  2. 2/2 git-svn: handle merge-base failuresAndrew Myrick, Jan 6, 2010
  3. Eric WongJan 6, 2010
  4. Sam VilainJan 6, 2010
  5. Eric WongJan 7, 2010
  6. Sam VilainJan 7, 2010
  7. Andrew MyrickJan 6, 2010
  8. 1/2 git-svn: ignore changeless commits when checking for a cherry-pickAndrew Myrick, Jan 7, 2010
  9. 2/2 git-svn: handle merge-base failuresAndrew Myrick, Jan 7, 2010
  10. Eric WongJan 7, 2010
  11. git-svn: update svn mergeinfo test suiteAndrew Myrick, Jan 21, 2010

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.