Stream: committers/git-help
Topic: Inserting branch name?
Lloyd McKenzie (Feb 01 2020 at 00:18):
Is there a mechanism where I can get cause the name of the branch something is in to render into a file? When we publish a branch, it would be nice if the header for the publication showed the branch name...
Grahame Grieve (Feb 01 2020 at 00:21):
this is a thing of beauty: https://stackoverflow.com/questions/6245570/how-to-get-the-current-branch-name-in-git
Grahame Grieve (Feb 01 2020 at 00:22):
but you might not even be in a git context
Grahame Grieve (Feb 01 2020 at 00:31):
it looks like we should put in the IG publisher
Grahame Grieve (Feb 01 2020 at 00:39):
I'll put in fhir.json in _data - "gitstatus" - that means it will be available anywhere through liquid
Grahame Grieve (Feb 01 2020 at 00:41):
will have n/a in it if the source isn't from git
Lloyd McKenzie (Feb 01 2020 at 00:47):
Be better for it to be blank than n/a - makes rendering easier
Grahame Grieve (Feb 01 2020 at 00:48):
ok
Grahame Grieve (Feb 01 2020 at 01:07):
will work next release
Lloyd McKenzie (Feb 01 2020 at 01:40):
What will it display if you're on 'master' (ideal would also be blank...)
Grahame Grieve (Feb 01 2020 at 03:15):
"master"
Lloyd McKenzie (Feb 01 2020 at 03:25):
Do you want to put the logic to suppress that in the publisher, or should I write the logic to suppress it in the template? (Because we don't want 'master' appearing.)
Grahame Grieve (Feb 01 2020 at 03:36):
I think that's a template choice
Last updated: Apr 12 2022 at 19:14 UTC