Skip to content
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

Merged
merged 5 commits into from
Dec 29, 2018

Conversation

j4yk
Copy link
Contributor

@j4yk j4yk commented Mar 11, 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...

fixup for 0458c6a "make updateSCCSVersions work in more situations"
which had to be reverted in b2efb7d
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.
@krono
Copy link
Member

krono commented Oct 18, 2018

@j4yk, can you tell me whether this is still relevant?

@j4yk
Copy link
Contributor Author

j4yk commented Oct 19, 2018

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?

@krono
Copy link
Member

krono commented Dec 29, 2018

@j4yk can you rebase onto Cog or merge Cog into here? let's see to get this going

@nicolas-cellier-aka-nice nicolas-cellier-aka-nice merged commit 1229447 into OpenSmalltalk:Cog Dec 29, 2018
@nicolas-cellier-aka-nice
Copy link
Contributor

Hi Tobias, I tried the resolve thru github which is a bit scary but OK for such simple change.
The sole conflict was your own change of a tab to spaces...

@fniephaus
Copy link
Member

fniephaus commented Dec 29, 2018

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 git stash.

@krono
Copy link
Member

krono commented Dec 29, 2018

@fniephaus We should ping vm-dev regarding that

@eliotmiranda
Copy link
Contributor

eliotmiranda commented Dec 29, 2018

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.

@fniephaus
Copy link
Member

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 sqSCCSVersion.h shouldn't change at all. More importantly, running the script manually also copies and, in our case, updates the script in the repository's hooks directory (see here) to configure Git for our needs. This change is within the .git directory and therefore doesn't alter your local copy, the OpenSmalltalkVM code base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants