Git
Commit history
The last 40 commits on a server's branch, drawn as a graph, with a card for whichever commit you point at.
Opening History#
On a server's Git tab, the HEAD card — the one titled with the branch — has a History button. History takes over the server's screen, and Back to the Git tab, or ←, returns. The header says what you are looking at — “Last 40 commits on main”, or “Last 40 commits from 7b21e4a9” when HEAD is detached, with a smaller number when there are fewer. That is the branch as it stood when History read it: switch branches while the screen is open and the rows stay as they were until you press Read the history again.
The button is there when the server runs directly on this computer, its branch has at least one commit, and git answers. Otherwise the card says why in its place:
- No git
- “Install git to see the history here.” On macOS: “Install the Xcode Command Line Tools to see the history here.”
- git not answering
- “git didn't answer, so Pip can't read the history here.”
- In WSL
- “History is read inside WSL.” Run
git login the distro itself. - In a container
- “History is read inside the container.”
- No commits yet
- There is no history to show, so there is no button.
Reading the graph#
History shows HEAD's own history: the commits your checkout contains, newest first, including the ones that arrived through merges. A branch that has not been merged into it is not drawn. Each row is a commit's subject — or “No commit message” — and how long ago it was authored. Beside the rows, the graph draws how the commits connect:
- The blue line
- HEAD's first-parent line, always in the left-hand lane, fading the further back it goes.
- Other colours
- Orange, coral and light blue, taken in turn by the other branches in the window, each in a lane of its own.
- Curves
- A line curving out of a merge commit carries the branch it merged. Where a lane curves back into another is the commit that branch forked from.
- The ringed dot
- HEAD — the newest commit, at the top.
- A fading tail
- A line that runs off the bottom and fades out carries on into history older than the window.
- A dashed column
- Past four lanes, every further branch shares a fifth, dashed column, so it never passes for one branch. A note under the graph counts them.
The commit card#
Point at a row, tab to it or click it, and a card opens under the commit — above it when there is no room below — then slides from row to row as you move. It closes when you move off the rows, or press Esc. With reduced motion turned on, it moves without sliding.
- Who and when
- The author's name, with their initials in place of an avatar — no image is fetched — and how long ago the commit was authored. That is the author date, which a rebase keeps.
- Message
- The whole subject, and up to three lines of the body.
- Changes
- “3 files changed · 1 binary”, then +412 and −37 for lines added and removed. A commit that changed nothing says “No files changed”. When git printed more than Pip reads, the last commit's count is a floor — “At least 2,000 files changed” — or “Too many files changed for Pip to count.”
- Merges
- “A merge: changes against its first parent.” Its counts and its diff are what it brought into the branch, as
git logshows them. - Diff
- A few lines of the busiest file — the one with the most lines changed — under its path, with one line of context around each change. Twelve lines at most, with ⋯ where git skipped lines between hunks, and “The diff goes on.” when there is more. A binary file says “Binary file: no lines to show.”, and a file that was only renamed or had its mode changed says “No line changes in this file.”
The diff is read only once a card has stayed open a moment, so sweeping the pointer down the list does not set git off forty times. Pip reads one diff at a time, the latest you asked for first, and keeps each until you close History; “Reading the diff…” shows meanwhile. If git fails, the card says so in git's words — “git couldn't show this diff:” and the reason, or “git didn't show this diff in 10 seconds.” — and opening the commit again tries once more.
Moving with the keyboard#
- ↓ or J opens the next older commit's card, and ↑ or K the next newer. With the card closed, the first press brings back the commit it last showed, or the newest.
- ↵ reopens the card of the row that has focus.
- Esc closes the card, and a second press closes History.
- ← goes back to the Git tab.
What History never shows#
History shows author names and never an email address from the commit. Pip asks git for the author's name alone, then takes every address out of what is left — the subject, the body, the name, and the path of the file the diff is from. An address in angle brackets goes, brackets and all; a bare one becomes …. Two lookalikes stay, because neither is anyone's address: an image's scale suffix such as icon@2x.png, and a package version such as react@18.3.1.
git's trailers go too. The block of them at the end of a message — Signed-off-by, Co-authored-by and any other Token: value lines there — is dropped, and so is a trailer naming a person further up the body. The diff lines are another matter: they are your file as git printed it, so an address written in the file itself shows there like any other line.
Notes and errors#
- “Older commits aren't shown: Pip reads the last 40.” There is more history past the window. Forty commits that reach the very first one say nothing.
- “This is a shallow clone, so its history stops where the clone began.”
- “git printed more than Pip reads, so only 12 commits are shown.” git's output — usually because one commit changed a great many files — ran past what Pip reads.
- “3 more branches share the last column.” The dashed column holds more than one branch.
When git cannot read the history, the screen says so — “git couldn't read the history:” and git's reason, or “git didn't finish reading the history in 10 seconds.” — with Try again under it. A server that has stopped, or a folder that is no longer a repository, is said plainly, with nothing to retry.
How it reads the repository#
Most of the Git tab comes straight from git's files in .git. History is one of the few places Pip runs the git installed on your computer instead: one git log when the screen opens or you read it again, never on a timer, and one git show for each diff a card asks for. To list the same commits and counts in a terminal:
git log --topo-order --max-count=40 --numstat --diff-merges=first-parentBoth only read. They write nothing, never ask for a password, and run with the repository's external diff programs, text conversion filters and signature checks switched off, so a repository's config cannot make git run a diff program, a conversion filter or gpg while History reads it. On git 2.44 or later nothing is downloaded, even in a partial clone that left file contents behind on the server — History shows git's error instead, usually “git couldn't read the history: …”, because the log counts lines in files the clone does not hold. An older git may try to fetch those, but never with a prompt — if it needs a password, it fails the same way. Closing History lets go of everything it read.
Did this page not answer it? Tell us what you were looking for — that is how Pip's documentation gets written.