eli-schwartz / aurpublish

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

Fix SRCINFO files being rolled back in worktree #8

Closed rafasc closed 4 years ago

rafasc commented 4 years ago

When commit is used with --only, which is the default behaviour when used with paths as arguments, git will skip changes present in the staging area and commit the specified files using the versions in the worktree.

To make this happen, git creates a temporary index with those files and passes control to the commit machinery. As a result, some operations are using an ephemeral version of the staging area that is discarded after the commit is completed.

This ultimately results in the appearance that changes done inside the pre-commit hook are being rolled back (in this case generating and adding .SRCINFO files) where in reality they are never getting into the "official" staging area in the first place.

To remedy this, let's add a post-commit hook that updates the "real" staging area with the changes made to .SRCINFO inside the pre-commit hook.

Fixes #7

eli-schwartz commented 4 years ago

Thanks for the great commit message!

force-pushed to sign the HEAD commit, and to add a line of whitespace between the shebang and the script contents.

rafasc commented 4 years ago

Thank you.