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

Issue with GitIsDirty and GitCache #60

Closed
annerajb opened this issue Nov 21, 2017 · 8 comments · Fixed by #165
Closed

Issue with GitIsDirty and GitCache #60

annerajb opened this issue Nov 21, 2017 · 8 comments · Fixed by #165

Comments

@annerajb
Copy link

I found a issue with a Solution with two projects using gitinfo.
They would fail on the String replace of the GitIsDirty while using the Git Cache file.
I suspect this is because the Variable GitIsDirty is not saved inside the gitcache text file and when applying the string substitution of the assembly file it would not replace it since it didn't find it.

I had to workaround it by always using GitSkipCache

@kzu
Copy link
Member

kzu commented Nov 23, 2017

@freza-tm
Copy link
Contributor

While working on a #156 I came to conclusion that the GitIsDirty cannot be cached as there is no way to invalidate the cache (cache invalidation depend on content of .git folder) and have to be queried on every build to be correct. Am I right?

@freza-tm
Copy link
Contributor

From my investigation, if I add the GitIsDirty to message in GitInfoReport task the output is correct for situation when moving from clean to dirty working directory. Unfortunately the task generating the source file is skipped with message "Target "GitVersion" skipped. Previously built successfully." This is in my opinion caused by input files containing only links to .git folder and there is nothing that changes with uncommited (unstaged) work. I'm not that strong with Msbuild to find workaround for this problem

@fabianoriccardi
Copy link

Hi, I think my question is related to this issue:

when I commit or make modifications, very often the IsDirty flag doesn't update (however other info always updates after the rebuild). Is it a way to make sure that this flag properly updates?

@kzu
Copy link
Member

kzu commented Jun 28, 2021

See #60 (comment). I don't really understand the usage of this property, it's there just because (IIRC) someone suggested it, but I've never had to use it for anything and I can't really think of a scenario where it would be useful for anything, honestly. Which is why it's super low priority for me to spend any time trying to fix this issue.

But I'll happily accept a PR that fixes it, of course :)

@freza-tm
Copy link
Contributor

It is useful to mark the binary built on local machine with uncommited changes

@fabianoriccardi
Copy link

Exactly, and it is also good feedback to be sure you are building and deploying with a clean working directory.

@kzu
Copy link
Member

kzu commented Jul 11, 2021

I version my locally built packages with a fixed number always, like 42.42.42, and CI always builds clean. So, again, I personally have no use for this feature. Happy to take a PR if this is important to you.

You could also opt to sponsor the project and that would bump the priority (see available tiers for that).

Thanks

@kzu kzu closed this as completed in #165 Aug 23, 2021
@devlooped devlooped locked and limited conversation to collaborators Sep 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants