eli-schwartz / aurpublish

PKGBUILD management framework for the Arch User Repository
GNU General Public License v2.0
246 stars 18 forks source link

Use better sanity check for 'abort if no commits' #4

Closed rafasc closed 5 years ago

rafasc commented 5 years ago

2d4274c (Abort when the repository has no commits., 2018-09-26) tries to exit gracefully with a helpful error message when it isn't possible to use git subtree because the repository is in the unborn branch state.

This usually happens right after the repository initialization but it can also happen after git checkout --orphan=foo. The current sanity check detects the former but not the latter.

Use rev-parse --verify in order to only proceed if HEAD is resolvable, detecting both cases.

eli-schwartz commented 5 years ago

Hmm, fair enough. (Why would someone do that... OTOH two commands are better than one, I suppose.)

eli-schwartz commented 5 years ago

How do I get github to acknowledge a manual cherry-pick... merged via c88459d5445d2b5dc98f5960bfb126eefe001db6.

rafasc commented 5 years ago

I should've also mentioned the two better than one, plus no subshell in the commit message. But got distracted with the why it doesn't work I mentioned on #3. Anyways... Thanks for taking it. :)