Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Ensure git index is refreshed before clean? check #99

Merged
merged 2 commits into from
Jan 22, 2021

Conversation

tomgi
Copy link
Contributor

@tomgi tomgi commented Jan 21, 2021

Hi,

I've encountered a problem with gem bump telling me that Uncommitted changes found. Please commit or stash. Aborting. in cases where I didn't have any uncommitted changes (and git status or git diff would agree with me on that ;)).

After doing some investigation I discovered that the underlying reason is a combination of a few things:

  1. I run my local gem development inside a docker container, with the entire gem working directory mapped as a volume inside the container
  2. git diff-index is lazy by default, i.e. it considers files to be different when the modification time differs (even when the actual content doesn't)
  3. The timezone inside of my docker container is different than my host timezone

As a result, git diff-index run inside of my docker container considers all files to be modified, which stops gem bump from doing its thing.

I found this git update-index --refresh command as a suggested solution to very similar problems described in

Thanks!

@coveralls
Copy link

coveralls commented Jan 21, 2021

Coverage Status

Coverage remained the same at 93.945% when pulling 7ce015d on tomgi:patch-1 into 7038416 on svenfuchs:master.

@PikachuEXE
Copy link
Collaborator

There is a comment suggesting
git update-index -q --really-refresh instead of
git update-index --refresh
What do you think?

@tomgi
Copy link
Contributor Author

tomgi commented Jan 22, 2021

Hey @PikachuEXE, to be fair I don't really understand the difference between --refresh and --really-refresh.

They both solve the problem in my case, but I guess there might be some other scenarios where only --really-refresh would do the trick.

I'll update the PR to do --really-refresh just to be extra safe, thanks for the suggestion!

@PikachuEXE PikachuEXE merged commit b44b80e into svenfuchs:master Jan 22, 2021
@PikachuEXE
Copy link
Collaborator

For some reason I can't release a new version via gem release --tag --push since it keep using the old version number
Strange~
image
image

@PikachuEXE
Copy link
Collaborator

OK resolved via adding bundle exec prefix:
bundle exec gem release --tag --push
Anyway it's released now

@tomgi tomgi deleted the patch-1 branch January 22, 2021 08:48
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants