Open mudrd8mz opened 9 years ago
In my script I used to use before switching over to mdk, I had something like this
BRANCHNAME=$(git branch 2> /dev/null | grep -e ^*\ | tr -d \*\ )
BRANCHHASH=$(git rev-parse $BRANCHNAME)
BASENAME=$(git for-each-ref --format='%(upstream:short)' $(git symbolic-ref -q HEAD))
BASEHASH=$(git rev-parse $BASENAME)
echo "Pull Diff URL: https://github.com/mudrd8mz/moodle/compare/$BASEHASH...$BRANCHHASH"
Those persistent urls are only persistent as long as github doesn't garbage collect them - note I use that technique on cibot but know that github docs do say they will eventually gc. Actually that gives me an idea that we could add an extra field in cibot report with an explicit github diffurl (we already link to patch file).
I created https://tracker.moodle.org/browse/MDLSITE-4162 for adding this sort of thing to cibot output (still useful to do this here IMO)
Do you mean that github's url .../compare/SHA1...SHA1 will stop working once the hashes are old enough or so?
If the source branch has been deleted, yes, eventually they run git-gc (probably): https://groups.google.com/forum/#!topic/github/ghXxynyhj0o
But... git-gc should not affect these SHA1 based diffs because the SHA1 still points to the valid commit even after it is merged into moodle.git branch.
I will prefer if I have an option to let mdk generate diff pull URLs in persistent format, i.e. with SHA1 hashes on both sides of the
...
operator.Such URLs like https://github.com/mudrd8mz/moodle/compare/ee78814...badfeed are valid forever and they work better for later references to the issue.