[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] Second attempt to improve updateSCCSVersions (#227)

Jakob Reschke notifications at github.com
Sun Mar 11 19:24:20 UTC 2018


I finally got around to solve the "not a git repository" issue with my previous pull request. For the analysis see below. Please review and try it out before merging.

When the script is run as a hook, the environment variable `GIT_DIR` is set to `.git` (path relative to the working tree) for regular repositories. This affects the behavior of `rev-parse`. When the script is run from the working tree and the checkout commands towards the bottom are executed, the script actually invokes itself as the post-checkout script. During that inner invocation, the script would `cd` to `.git/hooks`, and because of the GIT_DIR variable, `rev-parse` would then look for the git repository in `.git/hooks/.git`. This failed, of course.
The second error message "unrecognized input" came from `git apply` when it was fed with empty input (because there were no uncommitted changes to either *Version.h file).

Since GIT_DIR caused the trouble, why not use it to detect whether the script is run as a hook...
You can view, comment on, or merge this pull request online at:

  https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/227

-- Commit Summary --

  * Second attempt to improve updateSCCSVersions
  * Eschew --git-path because it was only added in Git 2.5
  * Properly handle staged changes to the version headers
  * whitespace

-- File Changes --

    M scripts/updateSCCSVersions (40)

-- Patch Links --

https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/227.patch
https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/227.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/227
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20180311/489efa72/attachment.html>


More information about the Vm-dev mailing list