Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pre-commit-ci/lite-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.2
Choose a base ref
...
head repository: pre-commit-ci/lite-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.1.0
Choose a head ref
  • 10 commits
  • 5 files changed
  • 2 contributors

Commits on Sep 11, 2024

  1. Update index before diff-index to check if there are changes

    It is possible to get to a state where diff-index shows that there is a diff,
    but there is nothing to commit.
    For example, when overwriting a file with its current context.
    
    Experiment:
    
    ```
    $ echo hello > foo.txt
    $ git add foo.txt
    $ git diff-index --no-ext-diff HEAD --
    :000000 100644 0000000000000000000000000000000000000000 ce013625030ba8dba906f756967f9e9ca394464a A      foo.txt
    $ git commit -m "Add foo.txt"
    [experiment b237cf0] Add foo.txt
     1 file changed, 1 insertion(+)
     create mode 100644 foo.txt
    $ git diff-index --no-ext-diff HEAD --
    $ echo hello > foo.txt
    $ git diff-index --no-ext-diff HEAD --
    :100644 100644 ce013625030ba8dba906f756967f9e9ca394464a 0000000000000000000000000000000000000000 M      foo.txt
    $ git commit -a
    On branch experiment
    nothing to commit, working tree clean
    $
    ```
    
    This scenario led to a confusing error:
    
    ```
    Traceback (most recent call last):
      File "/home/runner/work/_actions/pre-commit-ci/lite-action/v1.0.2/bin/main", line 298, in <module>
        raise SystemExit(main())
                         ^^^^^^
      File "/home/runner/work/_actions/pre-commit-ci/lite-action/v1.0.2/bin/main", line 270, in main
        commit = _make_commit(src_repo=args.src_repo, head=head, clone=clone)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/runner/work/_actions/pre-commit-ci/lite-action/v1.0.2/bin/main", line 57, in _make_commit
        subprocess.check_call(
      File "/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/subprocess.py", line 413, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '('git', '-c', 'user.name=does-not-matter', '-c', '[email protected]', '-c', 'protocol.version=2', '-C', '.', 'commit', '--all', '--quiet', '--no-edit', '--no-verify', '--message=hi')' returned non-zero exit status 1.
    ```
    
    This change refreshes the index before diff-ing it, avoiding the error.
    adamtheturtle committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    38ab68a View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2024

  1. Merge pull request #17 from adamtheturtle/update-has-changes

    Update index before diff-index to check if there are changes
    asottile authored Sep 12, 2024
    Configuration menu
    Copy the full SHA
    87b886c View commit details
    Browse the repository at this point in the history
  2. pre-commit autoupdate

    asottile committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    0a285f6 View commit details
    Browse the repository at this point in the history
  3. Merge pull request #18 from pre-commit-ci/autoupdate

    pre-commit autoupdate
    asottile authored Sep 12, 2024
    Configuration menu
    Copy the full SHA
    4d79555 View commit details
    Browse the repository at this point in the history
  4. v1.0.3

    asottile committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    1384014 View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2024

  1. Configuration menu
    Copy the full SHA
    6f4b769 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ea952db View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2024

  1. use upload-artifact v4

    asottile committed Oct 13, 2024
    Configuration menu
    Copy the full SHA
    3282fa3 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #20 from pre-commit-ci/upload-artifact-v4

    use upload-artifact v4
    asottile authored Oct 13, 2024
    Configuration menu
    Copy the full SHA
    3bad1be View commit details
    Browse the repository at this point in the history
  3. v1.1.0

    asottile committed Oct 13, 2024
    Configuration menu
    Copy the full SHA
    5d6cc0e View commit details
    Browse the repository at this point in the history
Loading