Skip to content

v1.9.0

Choose a tag to compare

@thomasbachem thomasbachem released this 21 Oct 07:30
· 79 commits to main since this release

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-unchanged or skip-worktree keep 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 --onto now 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, --patch or --put writing 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 --base above the other remedies
  • A run blocked by another session's pause suggests --wait=540 rather 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 – --onto falls back to the merge base, which after a rewrite of <upstream> sits below the real fork. It now names the --base run 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 --edits fold already did. One that inserts lines, or adds, removes or renames a file, still pauses
  • An --edits fold 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-into leads with --whole and --edits
  • Refusals name the next step more directly:
    • A file holding its own version of a landed block names the git diff to 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 --base first, then the merge to rebuild the input from
    • A fold that finds nothing staged offers --whole -- <files> first

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.verifyCmd once per directory, and reads HEAD from 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 --carry over 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 --carry added 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 --status names 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 --status named 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 --after or --before was pointed at a later commit. Its parent now runs the same check
  • --status offered 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 --put read 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.