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

Ability to generate persistent pull diff URLs #118

Open
mudrd8mz opened this issue Sep 3, 2015 · 6 comments
Open

Ability to generate persistent pull diff URLs #118

mudrd8mz opened this issue Sep 3, 2015 · 6 comments

Comments

@mudrd8mz
Copy link
Contributor

mudrd8mz commented Sep 3, 2015

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 mudrd8mz/moodle@ee78814...badfeed are valid forever and they work better for later references to the issue.

@mudrd8mz
Copy link
Contributor Author

mudrd8mz commented Sep 3, 2015

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"

@danpoltawski
Copy link
Contributor

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).

@danpoltawski
Copy link
Contributor

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)

@mudrd8mz
Copy link
Contributor Author

mudrd8mz commented Sep 3, 2015

Do you mean that github's url .../compare/SHA1...SHA1 will stop working once the hashes are old enough or so?

@danpoltawski
Copy link
Contributor

If the source branch has been deleted, yes, eventually they run git-gc (probably): https://groups.google.com/forum/#!topic/github/ghXxynyhj0o

@mudrd8mz
Copy link
Contributor Author

mudrd8mz commented Sep 3, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants