Support directory history

Aperta
#516 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
git, lua, neovim

Direzione di ricerca

Start with how :CodeDiff history parses its arguments, especially the -- separator, and how the single-file scope is passed through to the commit list. The issue names lua/codediff/ui/ and lua/codediff/ui/init.lua as test cases. Done when a pathspec after -- filters both the commit list and the files shown in the selected commit's diff, and the directory and file cases behave the same.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Type/Bug

Summary

I'd love to see :CodeDiff history support Git pathspecs, similarly to how the explorer already does.

For example:

:CodeDiff history -- lua/codediff/ui/

would show only commits that touched files under that directory, with only the changes to the files in that directory, much like:

git log -- lua/codediff/ui/

or, more generally, allow arbitrary Git pathspecs after --.

Motivation

When working on a larger project, I often want to browse the history of a subsystem or directory rather than the entire repository or a single file.

CodeDiff's history view is a really nice interface for exploring commits and viewing diffs, but currently the available scopes seem to be:

  • Entire repository
  • Single file

Having an intermediate directory/pathspec scope would make it much easier to navigate the history of larger codebases.

Current behavior

Passing a pathspec after -- appears to be silently ignored:

:CodeDiff history -- lua/codediff/ui/

still shows the full repository history.

Passing the directory as a positional argument gets closer:

:CodeDiff history lua/codediff/ui/

This filters the commit list to commits that touched files within the directory, but selecting a commit still shows all files changed by that commit, including files outside the directory. For larger commits, this makes it difficult to focus on the history of just that subsystem.

For comparison, a file path behaves as expected:

:CodeDiff history lua/codediff/ui/init.lua

Only that file's history and diffs are shown.

Note that even a file path is ignored when passed after --:

:CodeDiff history -- lua/codediff/ui/init.lua

which again shows the full repository history.

Expected behavior

Ideally, I'd expect :CodeDiff history to support Git pathspecs after --, so that both the commit list and the displayed diffs are scoped to the supplied path(s), whether that's a single file, a directory, or any other valid Git pathspec.

Lingua principale
Lua
Stelle
1.6k
Fork
104
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di esmuellert/codediff.nvim

Tutte le issue di esmuellert/codediff.nvim

Issue simili

Altre issue su Lua

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.