Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 0.7.0

- Contributors view in the Source Control panel: everyone who committed to the current branch, by number of commits
(one person per email, even with several names). Expand someone to see their commits and click one for its files.
The same commit menu as File History: copy the SHA, open it on the remote.
- Visual File History: the SHA in the tooltip no longer has extra background on its left, and counts of one say
"1 commit" and "1 author".
- Commit graph: commit details open instantly the second time (they are kept while the graph is open), without the
expand animation, and the loading placeholder only shows if loading takes a moment.
- Commit graph: easier to find where you are among many branches. Commits that are not in the history of your HEAD
are dimmed (toggle it with the target button in the toolbar), and when your commit scrolls out of view a "↑ main"
/ "↓ main" button takes you back to it, loading more commits if needed.
- Fix: on tall screens the rows of the commit graph no longer pop in all at once halfway down while it draws.

- The commit graph redraws by itself when any branch, remote branch, tag or stash moves: VS Code's background
auto-fetch (`git.autofetch`), a fetch or push from the terminal, or branches, tags and stashes made outside it.
Before, it only noticed changes to the current branch and to uncommitted files.
- Fix: hovering a row no longer clips the ring of the current branch badge or the node of the leftmost lane.

## 0.6.0

- Step through a file's revisions from the editor title: ← opens the diff of the previous commit to the file, → the
Expand Down
56 changes: 37 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Git Lore

Free and open-source Git superpowers for VS Code: blame, file and line history, a commit graph and branch comparison.
Free and open-source Git superpowers for VS Code: blame, file and line history, a visual file history, revision
navigation, a commit graph you can work from (branches, checkout, merge, cherry-pick, stash…) and branch comparison.
No account, no sign-in, no trial, no paywall, no telemetry. MIT licensed.

![Git Lore](images/icon.png)
Expand All @@ -16,26 +17,39 @@ No account, no sign-in, no trial, no paywall, no telemetry. MIT licensed.
- **File history and line history.** A *File History* view in the Source Control panel follows the active editor and
lists every commit that touched the file, renames included. Select some lines and run `Show Line History` (editor
context menu) to see only the commits that changed them. Click a commit to open its diff.
- **Contributors.** A *Contributors* view in the Source Control panel lists everyone who committed to the current
branch, by number of commits. Expand a person to see their commits; click one for its files and diffs.
- **Visual file history.** `Show Visual File History` (editor context menu, Explorer, or the icon in the File History
view) puts every commit to a file on a timeline: one row per author, dots sized by the lines changed, and added and
deleted lines underneath. Hover a dot for the commit, click it for its diff.
deleted lines underneath. Hover a dot for the commit, click it for its diff, or move between commits with the arrow
keys. Hover an author to highlight their commits.
- **Revision navigation.** The ← and → buttons in the editor title step through the commits that changed the file,
each as a diff; → from the newest commit returns to the working file.
- **Commit graph.** `Show Commit Graph` (the Graph button in the status bar, or the merge icon in the Source Control title) draws every branch, local and remote,
with branch and tag badges, in a full editor tab. Click a commit to open its details inline: full message, author,
parents and the changed files, each one opening its diff. A row above HEAD shows your uncommitted changes, and you can
show all branches, local branches only or the current branch. It loads more commits as you scroll and filters by
message, author, ref or SHA. Works the same on public and private repositories.
Right-click a commit (or press Shift+F10 on it) to create a branch or tag there, check it out, cherry-pick it, revert it
or reset the current branch to it. Right-click a branch or tag badge to check it out, merge it into the current
branch or delete it; checking out a remote branch creates the local branch that tracks it.
Right-click a file in the commit details to open its changes, open it at that revision, compare it with the working
file, open the working file, copy its path or restore it to that revision. The download button in the
graph toolbar fetches from all remotes. Deleting and `reset --hard` ask first.
Stashes appear as rows on the commit they were made on (apply, pop or drop them from their menu), and branches
checked out in other worktrees are marked, with an option to open that worktree in a new window.
- **Compare.** `Compare Branches or Refs…` (the compare icon in the Source Control title) lists the files that differ between two branches, tags or commits (you can
type any SHA), or between a ref and your working tree. Click a file for its diff; swap the sides from the view title.
- **Commit graph.** `Show Commit Graph` (the Graph button in the status bar, or the merge icon in the Source Control
title) draws every branch, local and remote, in a full editor tab, in the spirit of Git Graph.
- *Reading it:* colored lanes, with branch and tag badges in the color of their lane (local branches filled, remote
ones tinted, tags neutral). Hover a message, author or badge for the full text. A row above HEAD shows your
uncommitted changes. Choose all branches, local branches or the current branch, filter by message, author, ref or
SHA, and scroll to load more. Drag the graph's edge to make it wider (double-click to reset).
With many branches, commits outside the history of your HEAD are dimmed (toggle it from the toolbar) and a floating
button takes you back to your commit when it is out of view.
- *Commit details:* click a commit (or press Enter; arrows move between rows) to open its message, author, parents and
changed files inline. Each file opens its diff; right-click it to open it at that revision, compare it with the
working file, open the working file, copy its path or restore it to that revision.
- *Working from it:* right-click a commit (or Shift+F10) to create a branch or tag on it, check it out, cherry-pick
it, revert it or reset the current branch to it. Right-click a badge to check out, merge into the current branch or
delete it; checking out a remote branch creates the local branch that tracks it. The toolbar button fetches from
all remotes. Deleting and `reset --hard` ask first.
- *Stashes and worktrees:* stashes are rows on the commit they were made on (apply, pop or drop them from their
menu). Branches checked out in another worktree carry a folder icon, a detached worktree gets its own badge, and
you can open any of them in a new window.
- *Always current:* it redraws by itself when HEAD, your uncommitted files or any branch, tag or stash changes,
including fetches, pushes and branches made from the terminal. Turn on VS Code's `git.autofetch` to keep remote
branches fresh in the background.

Works the same on public and private repositories.
- **Compare.** `Compare Branches or Refs…` (the compare icon in the Source Control title) lists the files that differ
between two branches, tags or commits (you can type any SHA), or between a ref and your working tree. Click a file for its diff; swap the sides from the view title.

Everything is localized in English and Spanish.

Expand All @@ -47,6 +61,8 @@ Everything is localized in English and Spanish.

The colors are themeable: `gitLore.currentLineForeground`, `gitLore.fileBlameForeground`, `gitLore.fileBlameBackground`.

For a commit graph that keeps remote branches fresh, enable VS Code's `git.autofetch` (and `git.autofetchPeriod`).

If you also enable VS Code's own blame (`git.blame.editorDecoration.enabled`), you will see the blame twice; keep one.

## Requirements
Expand All @@ -56,8 +72,10 @@ It works in local folders and remote workspaces (SSH, WSL, containers).

## How it works

Git Lore only runs read-only git commands (`blame`, `log`, `show`, `diff`, `for-each-ref`) in your repository. It never
changes your repository, sends nothing anywhere and has no telemetry.
Git Lore runs `git` in your repository with the binary of the built-in Git extension. On its own it only reads (`blame`,
`log`, `show`, `diff`, `for-each-ref`, `stash list`, `worktree list`). It only changes your repository when you pick an
action in the commit graph (checkout, branch, tag, merge, cherry-pick, revert, reset, stash, restore a file, fetch),
and the destructive ones ask first. It sends nothing anywhere and has no telemetry.

## Contributing

Expand Down
2 changes: 2 additions & 0 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const comparar = require('./src/comparar');
const grafo = require('./src/grafo-vista');
const historia = require('./src/historia-vista');
const revisiones = require('./src/revisiones');
const contribuidores = require('./src/contribuidores');

const t = vscode.l10n.t;
let salida;
Expand Down Expand Up @@ -61,6 +62,7 @@ function activate(context) {
grafo.registrar(context, protegido);
historia.registrar(context, protegido, ficheroDelHistorial);
revisiones.registrar(context, protegido);
contribuidores.registrar(context, log);
}

function deactivate() { }
Expand Down
5 changes: 5 additions & 0 deletions l10n/bundle.l10n.es.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"{0} commits": "{0} commits",
"{0} has no older revisions": "{0} no tiene revisiones más antiguas",
"{0} no longer exists in the working tree": "{0} ya no existe en el árbol de trabajo",
"1 author": "1 autor",
"1 commit": "1 commit",
"All branches": "Todas las ramas",
"binary": "binario",
"Branch {0} is not fully merged. Delete it anyway?": "La rama {0} no está fusionada del todo. ¿Borrarla igualmente?",
Expand Down Expand Up @@ -31,8 +33,10 @@
"Files": "Ficheros",
"Filter by message, author, ref or SHA": "Filtrar por mensaje, autor, ref o SHA",
"Filter commits": "Filtrar commits",
"Go to the current commit": "Ir al commit actual",
"Graph": "Grafo",
"Graph width": "Ancho del grafo",
"Highlight the history of the current branch": "Resaltar la historia de la rama actual",
"Its changes can only be recovered by hand from git fsck.": "Sus cambios solo se podrán recuperar a mano con git fsck.",
"Its commits that are on no other branch can only be recovered from the reflog.": "Sus commits que no estén en otra rama solo se podrán recuperar del reflog.",
"Keep the changes staged": "Conserva los cambios en el índice",
Expand Down Expand Up @@ -65,6 +69,7 @@
"Restore": "Restaurar",
"Restore {0} to its version in {1}?": "¿Restaurar {0} a su versión de {1}?",
"Show commit": "Ver commit",
"Show Commit Files": "Ver ficheros del commit",
"Show Commit Graph": "Ver grafo de commits",
"Show in Source Control": "Ver en Control de código fuente",
"Show output": "Ver salida",
Expand Down
42 changes: 39 additions & 3 deletions media/grafo.css
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,41 @@ body {
#fetch:active svg { transform: translateY(2px); }
#fetch svg { transition: transform .2s var(--muelle); }
.boton:disabled { opacity: .5; cursor: default; }
#resaltar[aria-pressed="true"] { color: var(--vscode-focusBorder); background: var(--vscode-toolbar-activeBackground, var(--vscode-toolbar-hoverBackground)); }

/* lo que no es historia de HEAD queda en segundo plano; las líneas no, que son las que llevan a tu rama */
.fila > .texto, .fila > .autor, .fila > .fecha, .fila > .sha, .nodo { transition: opacity .2s ease-out; }
.resaltar .fila.ajena > .texto, .resaltar .fila.ajena > .autor, .resaltar .fila.ajena > .fecha,
.resaltar .fila.ajena > .sha, .resaltar .fila.ajena .nodo { opacity: .45; }
.resaltar .fila.ajena:hover > *, .resaltar .fila.ajena.seleccionada > * { opacity: 1; }

.aqui {
position: fixed;
right: 16px;
bottom: 16px;
z-index: 3;
max-width: min(60vw, 280px);
min-height: 32px;
padding: 0 14px;
overflow: hidden;
color: var(--vscode-button-foreground);
background: var(--vscode-button-background);
border: 0;
border-radius: 16px;
box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
font: inherit;
font-weight: 600;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
animation: aparecer .2s var(--salida);
transition: background .15s ease-out, transform .2s var(--muelle);
}
.aqui:hover { background: var(--vscode-button-hoverBackground); }
.aqui:active { transform: scale(.95); }
.aqui:focus-visible { outline: 2px solid var(--vscode-focusBorder); outline-offset: 2px; }
.fila.destello { animation: destello 1.2s var(--salida); }
@keyframes destello { 0%, 30% { background: color-mix(in srgb, var(--vscode-focusBorder) 35%, transparent); } }

.lista { padding-bottom: 8px; }

Expand Down Expand Up @@ -175,7 +210,8 @@ body {
.c7 { stroke: var(--c7); --tinta: var(--c7); } .nodo.c7 { fill: var(--c7); }
.nodo.head { stroke: var(--vscode-foreground); }

.texto { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
/* holgura de 3px con margen negativo: el aro de la rama actual sobresale del chip y el overflow lo cortaría */
.texto { display: flex; align-items: center; gap: 6px; min-width: 0; margin: -3px; padding: 3px; overflow: hidden; }
.resumen { flex: 1 1 0; min-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autor, .fecha { overflow: hidden; color: var(--suave); text-overflow: ellipsis; white-space: nowrap; }
.seleccionada .autor, .seleccionada .fecha { color: inherit; opacity: .85; }
Expand Down Expand Up @@ -260,9 +296,9 @@ body {
padding: 0 12px 0 8px;
background: color-mix(in srgb, var(--vscode-list-activeSelectionBackground) 12%, var(--vscode-editor-background));
border-bottom: 1px solid var(--borde);
animation: desplegar .22s var(--salida) both;
}
@keyframes desplegar { from { opacity: 0; clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
/* el detalle sale de golpe; la carga solo se ve si tarda: un commit ya visto o rápido no parpadea */
.cuerpo.cargando { animation: aparecer .2s var(--salida) .15s both; }
.carriles { display: block; height: 100%; }
.carriles line { stroke-width: 2; stroke-linecap: round; }

Expand Down
Loading