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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andrew Myrick <amyrick@xxxxxxxxx> 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.

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.

Thanks!

-- 
Eric Wong
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]