Skip to content

File changing commit clean-up#113

Merged
weswc merged 3 commits into
mainfrom
file_changing_commits
May 7, 2026
Merged

File changing commit clean-up#113
weswc merged 3 commits into
mainfrom
file_changing_commits

Conversation

@weswc
Copy link
Copy Markdown
Member

@weswc weswc commented May 7, 2026

In some projects, users were getting commits marked as file-changing that did not actually change the file. They would show up as black, affect the status, but when doing the diff, there would be no file change.

It was found ghqc used --full-history within the git log to determine file changing commits, which includes merge commits which may have edited the file on the branch, but to the same content as is on the current branch. Due to internal merge-branch behaviors, this was frequently occurring when a user would merge the core branch into their branch, then later merge their branch into the core branch, leading to the core->their merge causing a change on their branch but would not actually affect the core branch on the their->core merge.

Commits and their file changing behavior is cached to improve status determination speed. Since the logic to determine file changing commits changed, there are commits which are improperly marked after this change. To aide the process for users to remove cache entries for this change and going forward, this PR also introduces the ghqc cache command. It has subcommands remove, dir, and status to give insights into the cache for the user and easily remove entries. For this scenario, the recommendation will be to use ghqc cache remove commits --global to remove all cached commit entries for all repos and force a re-fetch.

@weswc
Copy link
Copy Markdown
Member Author

weswc commented May 7, 2026

Before

The last commit is marked as file changing, but when previewing the notification there is no difference

image image

@weswc
Copy link
Copy Markdown
Member Author

weswc commented May 7, 2026

Cache Clear

Status before

$ ghqc cache status
── Cache ─────────────────────────────────────
root:     /cluster-data/user-homes/wes/.cache/ghqc
size:     23.04 MB (1133 files)
ttl:      3600s (default; override with GHQC_CACHE_TIMEOUT)
── Repository ────────────────────────────────
repo:     org/repo
path:    $XDG_CACHE_HOME/.cache/ghqc/org/repo

  element          size    files
  -------          ----    -----
  commits      510.6 KB        1
  issues       753.4 KB       86
  users          7.9 KB       60
  labels              —        —

Remove commits

$ ghqc cache remove commits
removed /cluster-data/user-homes/wes/.cache/ghqc/a2-ai-science/Sun-Deuruxolitinib-AA/commits
cleared 1 cache directory

Status after

$ ghqc cache status
── Cache ─────────────────────────────────────
root:     /cluster-data/user-homes/wes/.cache/ghqc
size:     22.54 MB (1132 files)
ttl:      3600s (default; override with GHQC_CACHE_TIMEOUT)
── Repository ────────────────────────────────
repo:     org/repo
path:    $XDG_CACHE_HOME/.cache/ghqc/org/repo

  element          size    files
  -------          ----    -----
  commits             —        —
  issues       753.4 KB       86
  users          7.9 KB       60
  labels              —        —

@weswc
Copy link
Copy Markdown
Member Author

weswc commented May 7, 2026

After

We see 6aca7e2 among others are no longer listed and indicates its file changing

image

@weswc weswc merged commit 0463e8f into main May 7, 2026
4 checks passed
@weswc weswc deleted the file_changing_commits branch May 7, 2026 15:20
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.

1 participant