# Pre-commit failed tests

**URL:** <https://community.openastronomy.org/t/pre-commit-failed-tests/1149>\
**Category:** Astropy\
**Created:** [November 17, 2024, 5:56pm UTC](https://community.openastronomy.org/t/pre-commit-failed-tests/1149 "2024-11-17T17:56:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zerosumhippo](https://avatars.discourse-cdn.com/v4/letter/z/c4cdca/32.png) [@zerosumhippo](https://community.openastronomy.org/u/zerosumhippo)\
**Post date:** [November 17, 2024, 5:56pm UTC](https://community.openastronomy.org/t/pre-commit-failed-tests/1149/1 "2024-11-17T17:56:47Z")

</div>

Hello,

I’m trying to add a simple change to documentation related to [issue #16624](https://github.com/astropy/astropy/issues/16624). I’m just trying to removed the three paragraphs about affiliated packages in astropy/docs/development/codeguide.rst and replace them with a link to the affiliated packages information on the astropy website.

I keep running into `check-case-conflict` and `check-merge-conflict` (trace below) in Git when I attempt to commit my changes and I am, admittedly, super green, so I’m not sure how to go about solving this. Can anyone lend a hand?

```auto
check for added large files..............................................Passed
check for case conflicts.................................................Failed
- hook id: check-case-conflict
- exit code: 1

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "...\.cache\pre-commit\repo_o3jkek1\py_env-default\Scripts\check-case-conflict.EXE\ __main__.py", line 7, in <module>
    sys.exit(main())
             ~~~~ ^^
  File "...\.cache\pre-commit\repo_o3jkek1\py_env-default\Lib\site-packages\pre_commit_hooks\check_case_conflict.py", line 68, in main
    return find_conflicting_filenames(args.filenames)
  File "...\.cache\pre-commit\repo_o3jkek1\py_env-default\Lib\site-packages\pre_commit_hooks\check_case_conflict.py", line 29, in find_conflicting_filenames
    repo_files = set(cmd_output('git', 'ls-files').splitlines())
                     ~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^
  File "...\.cache\pre-commit\repo_o3jkek1\py_env-default\Lib\site-packages\pre_commit_hooks\util.py", line 23, in cmd_output
    raise CalledProcessError(cmd, retcode, proc.returncode, stdout, stderr)
pre_commit_hooks.util.CalledProcessError: (('git', 'ls-files'), 0, 128, '', b'error: missing config value GIT_CONFIG_VALUE_0\nfatal: unable to parse command-line config\n')

check json...........................................(no files to check)Skipped
check for merge conflicts................................................Failed
- hook id: check-merge-conflict
- exit code: 1

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "...\.cache\pre-commit\repo_o3jkek1\py_env-default\Scripts\check-merge-conflict.EXE\ __main__.py", line 7, in <module>
    sys.exit(main())
             ~~~~ ^^
  File "...\.cache\pre-commit\repo_o3jkek1\py_env-default\Lib\site-packages\pre_commit_hooks\check_merge_conflict.py", line 37, in main
    if not is_in_merge() and not args.assume_in_merge:
           ~~~~~~~~~~~ ^^
  File "...\.cache\pre-commit\repo_o3jkek1\py_env-default\Lib\site-packages\pre_commit_hooks\check_merge_conflict.py", line 20, in is_in_merge
    git_dir = cmd_output('git', 'rev-parse', '--git-dir').rstrip()
              ~~~~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "...\.cache\pre-commit\repo_o3jkek1\py_env-default\Lib\site-packages\pre_commit_hooks\util.py", line 23, in cmd_output
    raise CalledProcessError(cmd, retcode, proc.returncode, stdout, stderr)
pre_commit_hooks.util.CalledProcessError: (('git', 'rev-parse', '--git-dir'), 0, 128, '', b'error: missing config value GIT_CONFIG_VALUE_0\nfatal: unable to parse command-line config\n')

check for broken symlinks............................(no files to check)Skipped
check toml...........................................(no files to check)Skipped
check xml............................................(no files to check)Skipped
check yaml...........................................(no files to check)Skipped
detect private key.......................................................Passed
fix end of files.........................................................Passed
trim trailing whitespace.................................................Passed
rst directives end with two colons.......................................Passed
rst ``inline code`` next to normal text..................................Passed
no unicode replacement chars.............................................Passed
codespell................................................................Passed
ruff.................................................(no files to check)Skipped
ruff-format..........................................(no files to check)Skipped
sp-repo-review...........................................................Passed
changelog filenames..................................(no files to check)Skipped
changelog filenames for other category...............(no files to check)Skipped

```

---

<div class="post-metadata">

**Author:** ![neutrinoceros](https://dub1.discourse-cdn.com/flex005/user_avatar/community.openastronomy.org/neutrinoceros/32/589_2.png) [@neutrinoceros](https://community.openastronomy.org/u/neutrinoceros)\
**Post date:** [January 4, 2025, 6:23pm UTC](https://community.openastronomy.org/t/pre-commit-failed-tests/1149/2 "2025-01-04T18:23:52Z")

</div>

Hi @zerosumhippo, sorry about the late reply  
I’ve never seen such an error but it looks like something is broken on your system (either pre-commit or git itself).

You should be able to work around the problem by simply skipping pre-commit altogether when you commit with

```auto
git commit. ... --no-verify

```

or, to disable it permanently

```auto
pre-commit uninstall

```

of course this doesn’t solve the root issue. Have you tried opening an issue at [GitHub - pre-commit/pre-commit: A framework for managing and maintaining multi-language pre-commit hooks.](https://github.com/pre-commit/pre-commit/) ?
