Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Comments on What is the point of triggering CI/CD with an empty git commit?
Parent
What is the point of triggering CI/CD with an empty git commit?
I read posts (e.g., 1, 2, 3) that recommend triggering a CI build process by pushing an empty git commit.
I don't understand how this is a good idea as the commit history will be peppered with meaningless entries, and they can't be removed without re-writing the hashes (e.g., git rebase --interactive
, anything from this list), so any clean-up will require a force push (which should be avoided if others also work on that branch).
For example,
BEFORE REBASE:
* c074c70 (HEAD -> master) yet another major item
* bd8e835 trigger CI
* 49ddd75 trigger CI
* f895e9f this is important
* a7da744 trigger CI
* cec6a60 trigger CI
* 96e84f7 init
$ git rebase --interactive 96e84f7
AFTER DROPPING ALL EMPTY COMMITS:
* e441b17 (HEAD -> master) yet another major item
* fc67d54 this is important
* 96e84f7 init
THE ONLY COMMIT THAT RETAINED IT'S ORIGINAL HASH IS "init".
Post
The following users marked this post as Works for me:
User | Comment | Date |
---|---|---|
toraritte |
Thread: Works for me To the point, and explains exactly how it should be done without getting lost in specifics. |
Nov 9, 2023 at 14:19 |
LAFK | (no comment) | Nov 14, 2023 at 12:41 |
There's no point. It just causes unnecessary clutter and confusion.
The correct way is to configure a manual way for triggering the CI/CD pipeline. In most systems there should be an API endpoint for this. Or e.g. in Gitlab you can just navigate to Project > Pipelines and click Run pipeline
.
0 comment threads