-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Second attempt to improve updateSCCSVersions #227
Conversation
It is already three years old at this point, but some people might still run environments with older git versions. --git-dir, however, is 12 years old already.
Otherwise only the unstaged changes would be preserved.
@j4yk, can you tell me whether this is still relevant? |
Well I guess so for the benefits outlined in #213. But I cannot check now whether anything has changed in the baseline script in the meantime. Has anyone tried it, to avoid that it only works on my machine? |
@j4yk can you rebase onto Cog or merge Cog into here? let's see to get this going |
Hi Tobias, I tried the resolve thru github which is a bit scary but OK for such simple change. |
Now that this has been merged, do not forget to run the script manually once in order to update your local hooks. Otherwise, your local copy will still be using |
@fniephaus We should ping vm-dev regarding that |
First, Jakob, huge thanks for this. The weird symptom of getting merge conflicts appearing in certain files after each push has disappeared. Second, I did apply the script manually but it made no alterations to sqSCCSVersion.h in my case (it was already localized to my machine). So it may not be necessary to run it, but it does no harm. |
The behavior with regard to |
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 ofrev-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 wouldcd
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...