Re: [PATCH v2] branch: implement shortcut to delete last branch

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

 



On Fri, Mar 23, 2018 at 10:40:34PM +0000, Aaron Greenberg wrote:

> I updated the commit message to include my first email's cover letter
> and cleaned up the test.

Thanks. This one looks good to me.

> I can appreciate Matthieu's points on the use of "-" in destructive
> commands. As of this writing, git-merge supports the "-" shorthand,
> which while not destructive, is at least _mutative_. Also,
> "git branch -d" is not destructive in the same way that "rm -rf" is
> destructive since you can recover the branch using the reflog.

There's a slight subtlety there with the reflog, because "branch -d"
actually _does_ delete the reflog for the branch. By definition if
you've found the branch with "-" then it was just checked out, so you at
least have the old tip. But the branch's whole reflog is gone for good.

That said, I'd still be OK with it.

> One thing to consider is that approval of this patch extends the
> implementation of the "-" shorthand in a piecemeal, rather than
> consistent, way (implementing it in a consistent way was the goal of
> the patch set you mentioned in your previous email.) Is that okay? Or
> is it better to pick up the consistent approach where it was left?

I don't have a real opinion on whether it should be implemented
everywhere or not. But IMHO it's OK to do it piecemeal for now either
way, unless we're really sure it's time to move to respecting it
everywhere. Because we can always convert a
piecemeal-but-covers-everything state to centralized parsing as a
cleanup.

-Peff



[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