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

git.py(git_cmd): always pass "-c" "fetch.prune=false" to git #643

Merged
merged 1 commit into from
Jan 8, 2024

Conversation

glacambre
Copy link
Contributor

Problem: Anod sometimes breaks because users set fetch.prune=true in
their .gitconfig, which causes Git to remove references that are
actually required by Anod during git fetches.

Reproducer: Add the below snippet of code to your .gitconfig and run
anod update twice.

[fetch]
  prune = true

Solution: Make every git command run with -c fetch.prune=false. This
ensures that every git command will behave in an unsurprising way
with regards to reference pruning on fetch. When pruning references on
fetch is actually required, users of the git_cmd command will be
able to add --prune to their fetch subcommand.

Problem: Anod sometimes breaks because users set fetch.prune=true in
  their .gitconfig, which causes Git to remove references that are
  actually required by Anod during `git fetch`es.

Reproducer: Add the below snippet of code to your .gitconfig and run
  `anod update` twice.
  ```gitconfig
  [fetch]
    prune = true
  ```

Solution: Make every git command run with `-c fetch.prune=false`. This
  ensures that every git command will behave in an unsurprising way
  with regards to reference pruning on fetch. When pruning references on
  fetch is actually required, users of the `git_cmd` command will be
  able to add `--prune` to their `fetch` subcommand.
@CLAassistant
Copy link

CLAassistant commented Oct 6, 2023

CLA assistant check
All committers have signed the CLA.

@glacambre
Copy link
Contributor Author

@Nikokrock Sorry to bother you, but I'm not sure who would be the right reviewer for this PR. Could you have a look? (Also sorry for pinging you rather that setting the proper PR metadata, it looks like I don't have enough rights to do this.)

@leocardao leocardao merged commit 86972f6 into AdaCore:master Jan 8, 2024
6 checks passed
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.

3 participants