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: untrack changes in lua/user/ after installation. #985

Closed
wants to merge 1 commit into from

Conversation

ayamir
Copy link
Owner

@ayamir ayamir commented Sep 5, 2023

Add a step after installation to make git skip-worktree from user dir.
For users already using, execute the command manually:
Windows:

cd ~/AppData/Local/nvim
@(git ls-files lua/user) | ForEach-Object {&"git" update-index --skip-worktree $_}

*nix:

cd ~/.config/nvim
git ls-files -z lua/user/ | xargs -0 git update-index --skip-worktree

More info about assume-unchanged and skip-worktree: https://stackoverflow.com/questions/13630849/git-difference-between-assume-unchanged-and-skip-worktree

@popjdh

Signed-off-by: ayamir <lgt986452565@gmail.com>
@ayamir ayamir linked an issue Sep 5, 2023 that may be closed by this pull request
3 tasks
Copy link
Collaborator

@CharlesChiuGit CharlesChiuGit left a comment

Choose a reason for hiding this comment

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

Can confirm it works on macos.

@popjdh
Copy link
Contributor

popjdh commented Sep 5, 2023

Just now, I changed lua/user to lua/user_template through git mv. And also modified the installation script to automatically generate lua/user.

This is the PR #986 I submitted after modification.

@ayamir
Copy link
Owner Author

ayamir commented Sep 5, 2023

@popjdh I prefer this way to do the same thing instead of introducing template files due to redundancy.
Besides, using command to ignore won't influence current users who already customized their configs.

@popjdh
Copy link
Contributor

popjdh commented Sep 5, 2023

@popjdh I prefer this way to do the same thing instead of introducing template files due to redundancy. Besides, using command to ignore won't influence current users who already customized their configs.

  1. For some users who use local branch to manage configurations, git --skip-worktree will disrupt their management
  2. When modifying the preset lua/user, it is necessary to first git --no-skip-worktree before merging conflicts. Unless the preset is never changed, the consequences are equally cumbersome.

@popjdh
Copy link
Contributor

popjdh commented Sep 5, 2023

@popjdh I prefer this way to do the same thing instead of introducing template files due to redundancy. Besides, using command to ignore won't influence current users who already customized their configs.

In addition, for users who have already updated to the latest version, it is not a difficult problem to backup using methods such as "cp", "tar", etc😘

@ayamir
Copy link
Owner Author

ayamir commented Sep 5, 2023

@popjdh I prefer this way to do the same thing instead of introducing template files due to redundancy. Besides, using command to ignore won't influence current users who already customized their configs.

1. For some users who use local branch to manage configurations, `git --skip-worktree` will disrupt their management

2. When modifying the preset `lua/user`, it is necessary to first `git --no-skip-worktree` before merging conflicts. Unless the preset is never changed, the consequences are equally cumbersome.

You are correct, close it.

@ayamir ayamir closed this Sep 5, 2023
@ayamir ayamir deleted the fix/gitignore branch September 5, 2023 07:24
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.

Please change the preset 'lua/user' to 'lua/user_template' or others
3 participants