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

Fix pre-push.hook validation bug #152

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

vax-r
Copy link
Contributor

@vax-r vax-r commented Feb 20, 2024

Summary

We utilize ./scripts/pre-push.hook to do the checking when trying to do git push. One of the stages is to check a speicific commit hash number for validation of the repository.

It tries to get the hash number of commit 3ed17237af5b1ead6c394df5099bc2bc1f8392df, using a filter to get the value of commit whose git log message matches the pattern specified in line 15 of /scripts/pre-push.hook.

However when merging the commit into the master branch, it generated a new commit which is 390ade9eca44b432acb758084e7122cc2c46e485, so the value of commit in line 15 of /scripts/pre-push.hook will be incorrect.

That's why we modify a small part of the command in line 15 from -n 1 to --skip 1, so we can neglect the merging commit and get the actual commit hash number we want.

Fixed Issue

Fixed #151

We utilize ./scripts/pre-push.hook to do the checking when trying to do
`git push`. One of the stages is to check a speicific commit hash number
for validation of the repository.

It tries to get the hash number of commit
3ed1723, using a filter to get the
value of `commit` whose git log message matches the pattern specified
 in line 15 of `/scripts/pre-push.hook`.
However when merging the commit into the master branch, it generated a
new commit which is 390ade9, so the
value of `commit` in line 15 of `/scripts/pre-push.hook` will be
incorrect.

That's why we modify a small part of the command in line 15 from `-n 1`
to `--skip 1`, so we can neglect the merging commit and get the actual
commit hash number we want.

Fix sysprog21#151
@jserv jserv merged commit 4627f69 into sysprog21:master Feb 21, 2024
1 of 2 checks passed
@vax-r vax-r deleted the Fix_pre_push_hook_bug branch February 21, 2024 03:09
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.

Pre-push.hook check bug on validating repository
2 participants