Re: [PATCH] coccinelle: add and apply branch_get() rules

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

 



On 08-abr-2023 15:45:54, Junio C Hamano wrote:

> I do not know why you are
> arguing against my suggestion to improve your proposed log message.

Sorry, that's not my intention.  The recommendation still stands and the
message was not clear about it.

> >> Stepping back a bit.  What is the ultimate goal for this change?
> >
> > Of course, as you pointed out, there are usages where a computed value
> > is used, perhaps coming from the user, which might end up specifying
> > "HEAD".  Those usages of branch_get() are not considered here.  Not even
> > indirect ones.
> 
> That is what I found problematic, because I do not think this
> particular change will get us closer to the endgame of not feedling
> "" or "HEAD", if ...

The objective in this patch is to avoid having in the codebase
branch_get("HEAD") in favor of branch_get(NULL).  Because that's what we
recommend and, anyway, a smart compiler is going to optimize out that
strcmp with two literals.  Therefore, we follow the recommendations and
save some compiler effort in the way.

But, branch_get() cannot stop supporting a computed value that ends
being "HEAD", as a way to refer to the current branch.  However, maybe
you are suggesting so...



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

  Powered by Linux