/test/lint/lint-git-commit-check.sh
to a Python-script as part of the request of #24783 . Checked for output-consistency.
lint: Convert lint-git-commit-check.sh to Python #24853
pull Kvaciral wants to merge 1 commits into bitcoin:master from Kvaciral:lint-git-commit-check-port changing 2 files +63 −48-
Kvaciral commented at 12:09 pm on April 14, 2022: contributorA port of
-
DrahtBot added the label Tests on Apr 14, 2022
-
Kvaciral force-pushed on Apr 14, 2022
-
laanwj commented at 2:46 pm on April 14, 2022: member
Tested ACK 2e6cfc73007847b7c51de8f586cb67bd605200ed re-ACK f27fcd9bf4d667f78055d4b3ee6f426e4c5ffe16
0$ git commit --allow-empty -m $'invalid\ncommit\nmessage' 1[pull/24853/local-merge 8e2cddbb3a6163d47c728bdbb93bd57867bd180c] invalid commit message 2$ test/lint/lint-git-commit-check.py 3The subject line of commit hash 8e2cddbb3a6163d47c728bdbb93bd57867bd180c is followed by a non-empty line. Subject lines should always be followed by a blank line. 4$ git reset --hard HEAD~1 5$ test/lint/lint-git-commit-check.py
-
Kvaciral force-pushed on Apr 14, 2022
-
lint: Convert lint-git-commit-check.sh to Python f27fcd9bf4
-
in test/lint/lint-git-commit-check.py:27 in 2e6cfc7300 outdated
22+ the body or no body at all. 23+ """, 24+ epilog=""" 25+ You can manually set the commit-range with the COMMIT_RANGE 26+ environment variable. Defaults to current merge base when 27+ neither prev-commits nor the environment variable is set.
anibilthare commented at 10:04 am on April 16, 2022:I think it will be helpful to the user if we add an usage example forCOMMIT_RANGE
environment variable here, just how the help manual fortest/lint/lint-git-commit-check.sh
does it, something like:COMMIT_RANGE='b69fd5e...2e6cfc7' test/lint/lint-git-commit-check.py
Kvaciral commented at 1:41 pm on April 16, 2022:Yes, you’re right!Kvaciral force-pushed on Apr 16, 2022in test/lint/lint-git-commit-check.py:50 in f27fcd9bf4
45+ merge_base = check_output(["git", "merge-base", "HEAD", "master"], universal_newlines=True, encoding="utf8").rstrip("\n") 46+ commit_range = merge_base + "..HEAD" 47+ else: 48+ commit_range = os.getenv("COMMIT_RANGE") 49+ 50+ commit_hashes = check_output(["git", "log", commit_range, "--format=%H"], universal_newlines=True, encoding="utf8").splitlines()
anibilthare commented at 3:59 pm on April 17, 2022:Having an exception placed here would be nice? I was testing the code and figured out that it would crash if we setCOMMIT_RANGE
to something very random, like5
. If the code generates an exception we can convey something likePlease check the commit range
to the user?
Kvaciral commented at 12:56 pm on April 18, 2022:I prefer to not do that here, the current output (thegit log
-stuff and the subprocess-error) is clear enough. Besides, commit_range is usually only used by CI .. and furthermore, the lint-scripts are manually only used by devs and not (technical illiterate) end-users..laanwj merged this on Apr 18, 2022laanwj closed this on Apr 18, 2022
sidhujag referenced this in commit d100a1c133 on Apr 19, 2022bitcoin deleted a comment on Apr 27, 2022bitcoin locked this on Oct 11, 2023Labels
Tests
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 06:12 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 06:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me