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

Improve version display #168

Merged
merged 2 commits into from
Dec 10, 2017
Merged

Improve version display #168

merged 2 commits into from
Dec 10, 2017

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented Dec 7, 2017

By submitting this pull request, I confirm the following (please check boxes, eg [X]) Failure to fill the template will close your PR:

Please submit all pull requests against the development branch. Failure to do so will delay or deny your request

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.

How familiar are you with the codebase?:

10


Improve version display, fixes pi-hole/web#626

GIT_BRANCH will either be a hash (like 437af07) or a tag (like v2.12). Since . can never be part of a commit hash, we detect if the version is either of the format vX.YYY or vXX.YYY.

This template was created based on the work of udemy-dl.

…a deployed version or not

Signed-off-by: DL6ER <dl6er@dl6er.de>
@DL6ER DL6ER added the Bugfix label Dec 7, 2017
@DL6ER DL6ER requested a review from a team December 7, 2017 22:08
args.c Outdated
char version[] = GIT_BRANCH;
// Check if version is of format vX.YYY or vXX.YYY
// '.' can never be part of a commit hash
if(version[2] == '.' || version[3] == '.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be more future-proof?

if(strstr(version, ".") != NULL)

request.c Outdated
@@ -1038,7 +1038,8 @@ void getVersion(int *sock)
{
char server_message[SOCKETBUFFERLEN];

if(strcmp(GIT_BRANCH, "master") == 0)
char version[] = GIT_BRANCH;
if(version[2] == '.' || version[3] == '.')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See other comment

@DL6ER DL6ER changed the title Improve version display [WIP] Improve version display Dec 8, 2017
@DL6ER DL6ER changed the title [WIP] Improve version display Improve version display Dec 10, 2017
@DL6ER DL6ER merged commit 888bda2 into development Dec 10, 2017
@DL6ER DL6ER deleted the tweak/versiondisplay_travis branch December 10, 2017 12:43
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pi-hole-v3-2-1-released-with-lots-of-fixes/6096/1

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

Successfully merging this pull request may close these issues.

4 participants