-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Include boolean indicating whether working tree is dirty #10
Comments
Maybe. What kind of code would check for that? Are you thinking about a On Fri, Jul 8, 2016 at 9:31 PM Cameron Hobbs (カメロン・ホッブズ) <
|
I was thinking just a boolean available via (Note: I know nothing *.targets files or how you implemented the solution here, so anything I say is based on just looking over the source and making educated guesses.) Looking at GitInfo.targets, it looks like you were able to run git commands and send the output to a member, so my guess at a solution would be (pseudocode, as again my only experience with the syntax here is looking at what you already have):
Not sure what other plumbing would be needed to get things working, or if this will actually even do what I expect. Let me know if this makes sense. |
This sounds like an interesting feature. Will take a shot at implementing it when I have some spare cycles. Thanks! |
I came to the "Issues" tab to file a request for an "is dirty" property, and found that it already existed here. This feature would be very useful to distinguish between private dev builds. I would like to use it to try to automatically append "-private" to the version string, or something like that. A perhaps slightly more debuggable/understandable alternative to the diff-index command would be something like:
If there's no output, consider it "clean"; if there is output, it's dirty (and the output indicates which files are in question). (or maybe just omit the --quiet from the diff-index command, and look at its output instead of the return code) |
When you run
git describe --dirty
you get an additional "-dirty" string added if there are uncommitted changes to the repository. I think it would be useful to have access to this state, perhaps just as a boolean.If you are interested, I believe
git diff-index --quiet HEAD
will check this, returning 0 if clean and 1 if dirty.The text was updated successfully, but these errors were encountered: