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

Fix git init with core.hidedotfiles #131

Closed
wants to merge 1 commit into from

Conversation

dscho
Copy link
Member

@dscho dscho commented Feb 24, 2019

This fixes an regression that was not present in Git for Windows's original core.hideDotFiles patch, but in the shape of the core.hideDotFiles patch that made it into git.git.

We fixed it in one big hurry in Git for Windows, and I simply forgot to upstream this right away.

Changes since v1:

  • Clarified in the code comment that our intention is to pick up core.hidedotfiles in the first git_config() call.
  • Explained in the commit message why we cannot remove the git_config(git_init_db_config, NULL) call from create_default_files(): it would cause a change of behavior with regard to the init.templatedir setting.
  • Simplified the test case.

@dscho dscho added the ready to submit Has commits that have not been submitted yet label Feb 24, 2019
@dscho
Copy link
Member Author

dscho commented Mar 7, 2019

/submit

@dscho dscho removed the ready to submit Has commits that have not been submitted yet label Mar 7, 2019
@gitgitgadget
Copy link

gitgitgadget bot commented Mar 7, 2019

Submitted as pull.131.git.gitgitgadget@gmail.com

This is a brown paper bag. When adding the tests, we actually failed
to verify that the config variable is heeded in git-init at all. And
when changing the original patch that marked the .git/ directory as
hidden after reading the config, it was lost on this developer that
the new code would use the hide_dotfiles variable before the config
was read.

The fix is obvious: read the (limited, pre-init) config *before*
creating the .git/ directory.

Please note that we cannot remove the identical-looking `git_config()`
call from `create_default_files()`: we create the `.git/` directory
between those calls. If we removed it, and if the parent directory is
in a Git worktree, and if that worktree's `.git/config` contained any
`init.templatedir` setting, we would all of a sudden pick that up.

This fixes git-for-windows#789

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Member Author

dscho commented Mar 11, 2019

/submit

@gitgitgadget
Copy link

gitgitgadget bot commented Mar 11, 2019

Submitted as pull.131.v2.git.gitgitgadget@gmail.com

@gitgitgadget
Copy link

gitgitgadget bot commented Mar 12, 2019

This branch is now known as js/init-db-update-for-mingw.

@gitgitgadget
Copy link

gitgitgadget bot commented Mar 12, 2019

This patch series was integrated into pu via git@b2b8028.

@gitgitgadget gitgitgadget bot added the pu label Mar 12, 2019
@gitgitgadget
Copy link

gitgitgadget bot commented Mar 13, 2019

This patch series was integrated into pu via git@e907134.

@gitgitgadget
Copy link

gitgitgadget bot commented Mar 14, 2019

This patch series was integrated into pu via git@244a95b.

@gitgitgadget
Copy link

gitgitgadget bot commented Mar 18, 2019

This patch series was integrated into pu via git@980d11e.

@gitgitgadget
Copy link

gitgitgadget bot commented Mar 19, 2019

This patch series was integrated into pu via git@bc7ca16.

@gitgitgadget
Copy link

gitgitgadget bot commented Mar 20, 2019

This patch series was integrated into pu via git@521a344.

@gitgitgadget
Copy link

gitgitgadget bot commented Mar 20, 2019

This patch series was integrated into pu via git@d0a9f6c.

@gitgitgadget
Copy link

gitgitgadget bot commented Apr 1, 2019

This patch series was integrated into pu via git@cb17ca7.

@gitgitgadget
Copy link

gitgitgadget bot commented Apr 4, 2019

This patch series was integrated into pu via git@597fe3f.

@gitgitgadget
Copy link

gitgitgadget bot commented Apr 10, 2019

This patch series was integrated into pu via git@e539234.

@gitgitgadget
Copy link

gitgitgadget bot commented Apr 10, 2019

This patch series was integrated into next via git@1d57688.

@gitgitgadget gitgitgadget bot added the next label Apr 10, 2019
@gitgitgadget
Copy link

gitgitgadget bot commented Apr 16, 2019

This patch series was integrated into pu via git@6364386.

@gitgitgadget
Copy link

gitgitgadget bot commented Apr 16, 2019

This patch series was integrated into next via git@6364386.

@gitgitgadget
Copy link

gitgitgadget bot commented Apr 16, 2019

This patch series was integrated into master via git@6364386.

@gitgitgadget gitgitgadget bot added the master label Apr 16, 2019
@gitgitgadget gitgitgadget bot closed this Apr 16, 2019
@gitgitgadget
Copy link

gitgitgadget bot commented Apr 16, 2019

Closed via 6364386.

@dscho dscho deleted the unhidden-git branch April 17, 2019 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant