MetaMask / MetaMask/metamask-extension

[Fitness functions] Support git merge on pre commit hook

Open
#18,955 0 comments 0 reactions 0 assignees View on GitHub
team-extension-platform
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

When using pre-commit hooks, we currently use `git diff --cached HEAD` to get the diff.

When merging develop in, fixing conflicts, and then committing, the diff command fails with a circular reference error.

We should change the command so it supports both rebases and merges.

## Screenshots

![Screenshot 2023-05-02 at 19.02.24.png](https://images.zenhubusercontent.com/5c75618bd2f35e69f2b6ee08/af2c82cf-3250-4540-9476-c8c70da6eb46)

![Screenshot 2023-05-02 at 19.02.36.png](https://images.zenhubusercontent.com/5c75618bd2f35e69f2b6ee08/445e32b0-4667-43aa-867f-1f29e1ce33fc)

Contributor guide

Open the contributing guide

Research direction

Locate the pre-commit hook or fitness-function code that runs `git diff --cached HEAD`, then inspect how it behaves during a merge and a rebase. Reproduce the circular-reference failure and verify that the updated diff command works for both workflows without breaking the existing hook behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.