How do I get the short commit id versus the long one when using PHP for a webhook?How to get first 5 characters from stringHow much of a git sha is *generally* considered necessary to uniquely identify a change in a given codebase?How to disambiguate an ambiguous abbreviated sha1 in gitHow to modify existing, unpushed commit messages?How do I undo 'git add' before commit?How to list all the files in a commit?How to change the author and committer name and e-mail of multiple commits in Git?How do I undo the most recent local commits in Git?How to modify a specified commit?How do I make Git use the editor of my choice for commits?How to change the commit author for one specific commit?How do I revert a Git repository to a previous commit?Message 'src refspec master does not match any' when pushing commits in Git
Find The One Element In An Array That is Different From The Others
Did the Vulgar Latin verb "toccare" exist?
Contexte et orthographe du mot « feedback »
Print the last, middle and first character of your code
Shortest hex dumping program
Why didn't Nick Fury expose the villain's identity and plans?
What does (void *)1 mean
Why does the U.S. tolerate foreign influence from Saudi Arabia and Israel on its domestic policies while not tolerating that from China or Russia?
Does throwing a penny at a train stop the train?
For a hashing function like MD5, how similar can two plaintext strings be and still generate the same hash?
What prevents someone from claiming to be the murderer in order to get the real murderer off?
Is anyone advocating the promotion of homosexuality in UK schools?
How to memorize multiple pieces?
How to md5 a list of filepaths contained in a file?
Is there any word for "disobedience to God"?
Integer Lists of Noah
What's the point of having a RAID 1 configuration over incremental backups to a secondary drive?
Why was hardware diversification an asset for the IBM PC ecosystem?
Credit score and financing new car
Using Newton's shell theorem to accelerate a spaceship
Single word for "refusing to move to next activity unless present one is completed."
How do you move up one folder in Finder?
Is a request to book a business flight ticket for a graduate student an unreasonable one?
Why do people keep referring to Leia as Princess Leia, even after the destruction of Alderaan?
How do I get the short commit id versus the long one when using PHP for a webhook?
How to get first 5 characters from stringHow much of a git sha is *generally* considered necessary to uniquely identify a change in a given codebase?How to disambiguate an ambiguous abbreviated sha1 in gitHow to modify existing, unpushed commit messages?How do I undo 'git add' before commit?How to list all the files in a commit?How to change the author and committer name and e-mail of multiple commits in Git?How do I undo the most recent local commits in Git?How to modify a specified commit?How do I make Git use the editor of my choice for commits?How to change the commit author for one specific commit?How do I revert a Git repository to a previous commit?Message 'src refspec master does not match any' when pushing commits in Git
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
So I am using a PHP script to create a webhook with Gitlab. However, I am running into a slight issue. Finding the short commit ID. How would I find this? I can't seem to find it within PHP. Thanks!
The solutions I've seen are using the PHP exec() function which I definitely do not want enabled on my web server.
I expect the commit ID in the webhook to appear as something such as "2e54ar" rather than having the long string of numbers and letters.
php git gitlab
add a comment |
So I am using a PHP script to create a webhook with Gitlab. However, I am running into a slight issue. Finding the short commit ID. How would I find this? I can't seem to find it within PHP. Thanks!
The solutions I've seen are using the PHP exec() function which I definitely do not want enabled on my web server.
I expect the commit ID in the webhook to appear as something such as "2e54ar" rather than having the long string of numbers and letters.
php git gitlab
add a comment |
So I am using a PHP script to create a webhook with Gitlab. However, I am running into a slight issue. Finding the short commit ID. How would I find this? I can't seem to find it within PHP. Thanks!
The solutions I've seen are using the PHP exec() function which I definitely do not want enabled on my web server.
I expect the commit ID in the webhook to appear as something such as "2e54ar" rather than having the long string of numbers and letters.
php git gitlab
So I am using a PHP script to create a webhook with Gitlab. However, I am running into a slight issue. Finding the short commit ID. How would I find this? I can't seem to find it within PHP. Thanks!
The solutions I've seen are using the PHP exec() function which I definitely do not want enabled on my web server.
I expect the commit ID in the webhook to appear as something such as "2e54ar" rather than having the long string of numbers and letters.
php git gitlab
php git gitlab
asked Mar 26 at 2:13
Blizzard098Blizzard098
111 bronze badge
111 bronze badge
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
By default, a (GitLab or GitHub) webhook would always send a JSON payload including full SHA1 references in it, to avoid any confusion.
If you want short SHA1 (without executing any command), you could simply use substr
Would this commit ID still be valid? (i.e. searchable, etc.)
– Blizzard098
Mar 26 at 17:14
@Blizzard098 Most often, yes. If not, you can disambiguate it: stackoverflow.com/a/39930978/6309. see also stackoverflow.com/a/21015031/6309.
– VonC
Mar 26 at 17:19
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55348899%2fhow-do-i-get-the-short-commit-id-versus-the-long-one-when-using-php-for-a-webhoo%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
By default, a (GitLab or GitHub) webhook would always send a JSON payload including full SHA1 references in it, to avoid any confusion.
If you want short SHA1 (without executing any command), you could simply use substr
Would this commit ID still be valid? (i.e. searchable, etc.)
– Blizzard098
Mar 26 at 17:14
@Blizzard098 Most often, yes. If not, you can disambiguate it: stackoverflow.com/a/39930978/6309. see also stackoverflow.com/a/21015031/6309.
– VonC
Mar 26 at 17:19
add a comment |
By default, a (GitLab or GitHub) webhook would always send a JSON payload including full SHA1 references in it, to avoid any confusion.
If you want short SHA1 (without executing any command), you could simply use substr
Would this commit ID still be valid? (i.e. searchable, etc.)
– Blizzard098
Mar 26 at 17:14
@Blizzard098 Most often, yes. If not, you can disambiguate it: stackoverflow.com/a/39930978/6309. see also stackoverflow.com/a/21015031/6309.
– VonC
Mar 26 at 17:19
add a comment |
By default, a (GitLab or GitHub) webhook would always send a JSON payload including full SHA1 references in it, to avoid any confusion.
If you want short SHA1 (without executing any command), you could simply use substr
By default, a (GitLab or GitHub) webhook would always send a JSON payload including full SHA1 references in it, to avoid any confusion.
If you want short SHA1 (without executing any command), you could simply use substr
answered Mar 26 at 5:55
VonCVonC
876k318 gold badges2832 silver badges3392 bronze badges
876k318 gold badges2832 silver badges3392 bronze badges
Would this commit ID still be valid? (i.e. searchable, etc.)
– Blizzard098
Mar 26 at 17:14
@Blizzard098 Most often, yes. If not, you can disambiguate it: stackoverflow.com/a/39930978/6309. see also stackoverflow.com/a/21015031/6309.
– VonC
Mar 26 at 17:19
add a comment |
Would this commit ID still be valid? (i.e. searchable, etc.)
– Blizzard098
Mar 26 at 17:14
@Blizzard098 Most often, yes. If not, you can disambiguate it: stackoverflow.com/a/39930978/6309. see also stackoverflow.com/a/21015031/6309.
– VonC
Mar 26 at 17:19
Would this commit ID still be valid? (i.e. searchable, etc.)
– Blizzard098
Mar 26 at 17:14
Would this commit ID still be valid? (i.e. searchable, etc.)
– Blizzard098
Mar 26 at 17:14
@Blizzard098 Most often, yes. If not, you can disambiguate it: stackoverflow.com/a/39930978/6309. see also stackoverflow.com/a/21015031/6309.
– VonC
Mar 26 at 17:19
@Blizzard098 Most often, yes. If not, you can disambiguate it: stackoverflow.com/a/39930978/6309. see also stackoverflow.com/a/21015031/6309.
– VonC
Mar 26 at 17:19
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55348899%2fhow-do-i-get-the-short-commit-id-versus-the-long-one-when-using-php-for-a-webhoo%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown