Support directory history

Abierto
#516 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Tranquilo
Stack tecnológico
git, lua, neovim

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Lua
Estrellas
1.6k
Forks
104
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de esmuellert/codediff.nvim

Todos los issues de esmuellert/codediff.nvim

Issues similares

Más issues de Lua

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.