Re: [PATCH 4/5] status: show worktree status of conflicted paths separately

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

 



On Wed, Aug 05, 2009 at 02:15:45AM -0700, Junio C Hamano wrote:

> +	switch (d->stagemask >> 1) {
> +	case 1: how = "both deleted"; break;
> +	case 2: how = "added by us"; break;
> +	case 3: how = "deleted by them"; break;
> +	case 4: how = "added by them"; break;
> +	case 5: how = "deleted by us"; break;
> +	case 6: how = "both added"; break;
> +	case 7: how = "both modified"; break;
> +	}

Ugh. Can we use symbolic constants for the stagemask instead of a
bitshift and some magic numbers? I understand it's a mask and not just
an integer value, but we are clearly enumerating every possibility here.

> +	color_fprintf(s->fp, c, "%-20s: %s\n", how, one);

This produces output like:

#       both modified       : a
#       deleted by us       : b
#       deleted by them     : c

Maybe it is just me, but I think the whitespace with the colon looks
awful. You could do just:

#       both modified:        a
#       deleted by us:        b
#       deleted by them:      c

which matches the other status output, or even left-prefix the spaces:

#              both modified: a
#              deleted by us: b
#            deleted by them: c

-Peff
--
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]