Skip to content

Fix failure of retrieving git hash from a hg-git enabled repository#1138

Merged
gmaurel merged 1 commit intouncrustify:masterfrom
Unity-Technologies:fixes/build/make-version
May 6, 2017
Merged

Fix failure of retrieving git hash from a hg-git enabled repository#1138
gmaurel merged 1 commit intouncrustify:masterfrom
Unity-Technologies:fixes/build/make-version

Conversation

@mihaipopescu
Copy link
Copy Markdown
Collaborator

It also improves a bit the messaging when there is a failure retrieving the hash from a VCS which can be at times confusing #1137.

This re-integrates 3ef03cd back.

@gmaurel gmaurel merged commit 18067cf into uncrustify:master May 6, 2017
@CDanU
Copy link
Copy Markdown
Collaborator

CDanU commented May 6, 2017

Uff, I just wanted to started reviewing this.

error_txt = "%d: %s" % (proc0.returncode, error_txt_b.decode("UTF-8").strip().lower())

proc1 = Popen(['git', '--git-dir=.hg/git', 'describe', '--tags', '--always','--dirty', node], stdout=PIPE, stderr=PIPE)
proc1 = Popen(['git', '--git-dir=.hg/git', 'describe', '--long', '--tags','--always', node], stdout=PIPE, stderr=PIPE, cwd=root)
Copy link
Copy Markdown
Collaborator

@CDanU CDanU May 6, 2017

Choose a reason for hiding this comment

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

Thanks for the fixes, here are some notes/questions:

Why are the git flags changed? If I remember correctly I removed the -long to prevent a commit hash string on a tagged commit (the actual release).

Uncrustify-0.64 vs Uncrustify-0.64-something

The -dirty flag should not be removed as it is useful information when we receive bug reports. It could be that the uncommitted dirty changes are causing bugs.

E: Ohh I see its in the hg branch. Still wouldn't hurt right?

EE: Ok, It seems there is a problem somewhere.

Fix failure of retrieving git hash from a hg-git enabled repository ...


I am not sure why cwd=root was added. Did it cause problems without it somewhere?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It's a special setup as I'm not under git but it's an hg repository with a git remote using hggit extension.

I'll try without --long but -dirty doesn't work in my case. It fails with a strange error (iirc something about comittish, was funny).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think this is the closest I ended up matching the git version but indeed, maybe some things have changed. Sorry not taking this into account.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants