Repository navigation
v1.9.0
git-edit 1.9.0 makes shared checkouts safer and runs faster. It fixes the ways a sync or carry could stage your uncommitted edits or leave a file stale, the landings check refuses less of your own work, and --onto can replant from a fork you name.
Highlights
- Your uncommitted work stays as it was. A sync no longer stages edits you left unstaged, and files you flagged
assume-unchangedorskip-worktreekeep their hidden edits out of the index and still come along with what landed - The landings check refuses less of your own work – five kinds of edits it took for taking back another session's landing now pass. One case is stricter: an input writing over most of a block another session just added needs
--base --onto=<upstream> --base=<sha>replants from the fork you name, for when<upstream>'s reflog can't tell – and--ontonow says so and suggests the<sha>- Faster – a drop over thousands of flagged files takes seconds instead of minutes, the landings check runs its merges side by side, and each run starts about a fifth fewer git processes
Upgrading from 1.8.0
--edits,--patchor--putwriting over half or more of a block another session added now refuses – a file built before the block was added looks the same and would take it back. Pass--base=<tip>where rewriting the block is the point- A reword prints the commit it landed last, right above the trailer, and gives its body as a line count – "(with a 2-line body)" – rather than printing it. A batch reword lists its commits last too
- A fold whose branch moved says "moved … during the fold" and its conflict "Conflict during the fold", where 1.8.0 named the autosquash behind it. An edit says "during the edit"
- When the landings check refuses, its trailer names each landing by label and range, with
--baseabove the other remedies - A run blocked by another session's pause suggests
--wait=540rather than 600, leaving a 10-minute call timeout a minute for the run itself
New
--onto=<upstream> --base=<sha>replays only the commits after<sha>, and lists the ones up to it that<upstream>holds in no form- Where
<upstream>'s reflog can't answer – a fresh clone, an expired reflog –--ontofalls back to the merge base, which after a rewrite of<upstream>sits below the real fork. It now names the--baserun that avoids that, with the newest of your commits<upstream>holds a copy of as<sha>, and repeats it at a conflict pause - A fold of staged changes or of whole files that only replaces lines resolves its replay's stops itself, as an
--editsfold already did. One that inserts lines, or adds, removes or renames a file, still pauses - An
--editsfold beside files taken whole resolves its stops the same way git edit -h <flag>opens a long entry with its usage lines, and-h --amend-intoleads with--wholeand--edits- Refusals name the next step more directly:
- A file holding its own version of a landed block names the
git diffto read before--base, not a--carry, which would add the block a second time - An input taking back a landing the checkout never got names
--basefirst, then the merge to rebuild the input from - A fold that finds nothing staged offers
--whole -- <files>first
- A file holding its own version of a landed block names the
Faster
- Flagged files a landing changes come along in one merge instead of one each – a drop over 3,000 of them took minutes
- The landings check runs its merges eight at a time and keeps each verdict for the run, saving a few seconds on a file many landings changed
- A run asks git for a checkout's top, git dir, common dir and
edit.verifyCmdonce per directory, and readsHEADfrom its file
Fixed since 1.8.0
Your uncommitted work
- A sync staged edits you had left unstaged, where the file's index entry was already on what landed – a landing the checkout missed, then
git checkout -- <file>and an edit - A
--carryover a flagged file staged its hidden edits, and a sync over one that also had staged edits staged them all. Hidden edits now count as unstaged, as an unflagged file's do - A flagged file touched but not edited kept its old content while its index entry took what landed, and the flag hid that from
git status - A sync or
--carryadded a landed block a second time to a file holding its own version of it. Such a file is now left as it is, and--statusnames it - A run stopped twice by a signal during its checkout sync could leave a revert of the landing staged
The landings check refused your own work
- A whole file editing a landed block together with the line beside it
- A whole file holding a landed block beside lines you removed, where git's merge would add the block a second time
- Renaming a file another session added
- A change to a file whose landing was dropped since, or put back as before
- A file you merged by hand after a sync left it on a conflict – which also kept its record for 7 days, so
--statusnamed it and each later landing merged it from the stale base
Elsewhere
- A file built before another session added a block, with a line of its own in the block's place, read as an edit of the block – and took it back
- A new commit failing the gate was blamed for a failure its parent shares, and one placed with
--afteror--beforewas pointed at a later commit. Its parent now runs the same check --statusoffered a carry from a recorded base past the landings on record, which would merge every edited file from that base. It names that file's own merge now- A run stopped while writing index entries named its own index lock as another's, and could remove one a peer took since
- On Linux without a working
ps– a minimal image, BusyBox – a run a landing's hook started waited out the journal's lock rather than refusing at once, and another user's live process could read as gone git edit -h --edits --putread the second topic as the first one's value
brew install thomasbachem/tap/git-edit
Or brew upgrade git-edit where it is already installed, or pull the repo if its folder is on your PATH.