Skip to content

Releases

v1.11.0

Choose a tag to compare

@thomasbachem thomasbachem released this 13 Nov 22:08

git-edit 1.11.0 runs a lost race again by itself, lands moves and placements 1.10.0 refused as taking in a later change, and puts each refusal's remedy on its trailer line.

Highlights

  • A run that loses the race runs itself again on the new tip, up to twice, each loss named as it goes – where a refused run used to be rerun by hand. It does so only where a fresh run composes it all again from the same arguments, so never an --exec, a --continue or a --text -
  • Every refusal's trailer carries its remedy. A caller keeping only the git-edit: line learns there what to do next – the --wait for another session's pause, the saved output of a failed check, the first entry and count of a list, the commits writing a line --edits can't find
  • A squash into a newer target replays its older commits right before it, as the target was built on them, instead of after it as fixups – so it no longer stops on the target's own pick. The fold keeps the target's authorship, and --text, -m's message or its own
  • More moves, placements and removals land. A placement moving a line a later commit rewords and a move past a code relocation were refused as taking in a later change, and a removal as taking back what another caller landed on its file, though that content had moved into other files the commit changes – each now lands
  • A fold that needs lines a later commit adds is shown how to move them. Its refusal names a --split of that commit into those lines as a fixup! of the target, which keeps the tip as it was

Upgrading from 1.10.0

  • A lost race reruns itself – GIT_EDIT_NO_RERUN=1 keeps every loss a refusal, as before
  • A squash refused at its tip exits 2, as it stays paused, where 1.10.0 exited 1
  • A move its own resolution broke outright refuses with nothing applied, naming a rerun under GIT_EDIT_NO_SELF_RESOLVE=1 – 1.10.0 paused, offering a continue that refused again
  • Below git 2.50, a block the moved commit adds goes back out of a crossed stop by its content and lands, where it paused
  • A bare -s=auto takes your fixups that a split, reword or fold of yours gave a new subject or paths – and a fixup another caller rewords becomes theirs
  • A refusal for a resolution taking in a later commit's change names, for each loss, the stop holding it and one of its lines, as "an earlier stop's commit"
  • The output grep the README documents keeps the lines above each match, where a refusal prints its remedy

New

  • --edits that a target lacks offers git edit <target>, its pause, to make the edit there by hand
  • A long reorder – past 12 commits – lists the moved commits beside the one each now follows, the stretches between them counted
  • A move's pause lists the files staged clean that hold lines a moved commit still to come adds
  • An emptied stop names the commit it builds on by its changed lines, not just its file
  • --commit's hook refusal names the worktree link, and says where --no-verify leaves the repository's hooks running
  • The README shows how to share edit.* settings through an included tracked file, and lists the move and reorder checks a verify runs at

Fixed since 1.10.0

What a run lands

  • A move landed a crossed commit without its edit of other words in a line the moved commit rewrote – that edit now pauses rather than go with the moved commit
  • A reorder after another session's rewrite was refused as unreachable – it now runs again on the new tip
  • A bare -s=auto skipped your own fixups once a split, reword or fold had reshaped them, --status calling them "made outside git-edit"

What it tells you

  • A squash refused at its tip could name the wrong commit for its lost lines, reading only the first 5 files the result differed in
  • --status named no owner for a pause that ended as it read it
  • --status named a checkout left behind after a reword, or a move or squash keeping the tip's tree – the --carry it offered found nothing to bring

v1.10.0

Choose a tag to compare

@thomasbachem thomasbachem released this 28 Oct 04:43

git-edit 1.10.0 resolves by itself far more of the stops a replay hits – in every fold and squash, and now in placements, moves and edits – and fixes a flaw in 1.8 and 1.9 that could land a fold's change on the wrong line.

Highlights

  • Stops resolve themselves where your own change says how. Each line your change replaces is followed through every later commit's own change to where it stands at the stop – and where it could stand in two places, the run pauses
  • A move takes the moved commit's lines past each commit it crosses. Each crossed commit keeps its own edits, those right beside the moved lines too, and its edits to the moved lines themselves land with the moved commit, named – where 1.9.0 paused at each such crossing
  • Tags edit.followTag names follow a rewrite – a release's cut marker, say, moves to what the rewrite made of its commit, and --undo puts it back. A signed tag, or one whose counterpart is only a guess, stays where it was, named
  • A fold flaw in 1.8 and 1.9 is fixed. A fold put its change wherever the stopped commit held the old text exactly once – so where a later commit had rewritten that line and written the same text elsewhere, it landed on the wrong line while reporting ok. Runs that printed "Made the edits in …" or "Made the fold's line replacements in …" worked that way, and where their files repeat lines, the commits' diffs are worth a look
  • -s=auto squashes each fixup!, amend! or squash! commit into the one it names, all in one replay. Bare, it takes the pending ones you landed – by your GIT_EDIT_ACTOR label, or all unlabeled ones without one – and --status lists who landed each
  • A pause holds only its own branch – runs on other branches go ahead beside it

Upgrading from 1.9.0

  • --patch, --put and --tree folds, squashes and every resume now resolve their stops too. GIT_EDIT_NO_SELF_RESOLVE=1 leaves every stop to you
  • Some stops 1.9.0 resolved now pause – where a line or its words could pair as well with another of the same text, or across a commit that rewrote the file as git diff -B reads it. More pause on git before 2.50, whose --minimal diff isn't exact
  • --onto and --land leave out the commits their triage lists as already upstream, however upstream changed them since. 1.9.0 replayed such a commit – stopping where upstream rewrote a line, or bringing back a part it reverted
  • A pause counts its remaining steps and names only those touching a conflicted file – --status lists them all
  • A placement refused for building on a later commit's change says so, and --status offers only --abort for a refused replay
  • Where a crossed commit rewrote moved lines together with older ones – a rewrapped paragraph, say – the whole hunk goes with the moved commit while the moved lines are at least half of it, named, and the move pauses otherwise. Lines a crossed commit inserted stay with it, between two moved lines too
  • A move carrying a crossed commit's edits amends the commit taking them in, running prepare-commit-msg and post-commit once more for it

New

  • amend! and squash! markers count in a squash without --text: An amend! message replaces its target's, and a squash! one's body is added
  • A stop where a later commit rewrapped a replaced line resolves by the line's changed words
  • edit.<path>.lockfile and edit.<path>.installCmd check a commit below a dependency upgrade on its own install, not on the one an edit.worktreeLink link holds
  • GIT_EDIT_ACTOR_NAME – a session's title, say – names a pause's owner beside its label
  • git edit -h maps config keys and usage words – <sha>, fixup, tier – to their entries
  • Where a fold's own step needs a line a later commit wrote, it names that commit
  • A stale SHA's error line names its counterpart, and a squash refused at its tip names the commits behind it

Faster

  • A resume over a large sweep checks each stop's paths in one batch – a 230-file resume took 29 s instead of 371 s
  • Resuming a squash refused at its tip, with nothing changed, refuses at once rather than after minutes of checks

Fixed since 1.9.0

What a run lands

  • On git 2.56, resuming a replay refused where git had dropped a pick that came out empty, reading it as taken out by hand
  • A drop or squash that left its commits in the branch – a todo edit matching nothing, a rebase begun by hand from the run's own base – said "squashed into …" while reporting ok. It now refuses
  • A fold resolving its own stops failed when TMPDIR held a space, and ran a $(…) it held
  • With rerere.enabled=false, a run could forget conflict resolutions another run still in progress had recorded

What it tells you

  • --status read a rebase begun by hand, or a replay finished there, as a conflict without files
  • On older git, --status printed each remaining step's subject twice
  • A paused squash was named by the newest commit it was given, not the ones it squashes into
  • A run blocked by your own pause read as if another session held it
  • --onto printed "fatal: ambiguous argument" for a branch named like a folder
  • A file conflicting with a landing a rewrite replaced read as predating it – it now names the git diff to read before --base
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.

v1.9.0

Choose a tag to compare

@thomasbachem thomasbachem released this 21 Oct 07:30

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.

v1.8.0

Choose a tag to compare

@thomasbachem thomasbachem released this 10 Oct 16:50

git edit --land=<branch> lands a finished branch on the checked-out one in a single call – a fast-forward where it can, else a replay onto the tip in a worktree of its own – beside other sessions' uncommitted work. What lands is the commits the checked-out branch never held, read from its reflog, so a land taken back, a catch-up or a rewrite of the target neither leaves the branch's commits out nor brings back what the target dropped. A commit that looks like a copy of one the target holds – a cherry-pick, or one reworded since it landed – refuses rather than be guessed at, naming the steps that bring its change in or leave it out.

git edit --commit and --amend-into now compose a commit from your own edits alone – a peer's lines in the same file and its staging stay out – and --after/--before land it beside the commit it belongs with, in one run. Every edit, drop and squash now runs in a worktree of its own, a terminal's run too, and once a run lands, the checkout it started in comes along. A run that can no longer land stops at once, and a pause wins over a run already in flight, so sessions sharing a branch no longer lose finished conflict resolutions.

-M --subject=<line> replaces a commit's subject alone, its body kept byte for byte. A run blocked by another session's pause waits up to 90 s for it to clear, then runs on what that pause landed – --wait=<secs> sets the bound. And git edit -h <topic>... prints the manual's entries for flags or sections as plain text, one call where a lookup used to grep --help.

Upgrading from 1.7.0

  • Once a run lands, the checkout it started in comes along – an agent's run too, where 1.7.0 printed steps to run, bar --onto
  • GIT_EDIT_NO_AUTO_ISOLATE is gone, ignored now – every edit, drop and squash runs isolated, -C naming where
  • At a terminal, Ctrl-C at a pause leaves it for later and Escape cancels only when pressed twice, where 1.7.0 aborted on either
  • An option error prints its refusal and a pointer to git edit -h <flag>, no longer the whole usage – a bare git edit still shows it
  • Upgrade every copy that works on a repository together: 1.7.0 reads 1.8.0's undo records as runs, so its --undo would redo a run 1.8.0 took back

What 1.7.0 accepted and this release refuses, each refusal naming why:

  • A flag's value given apart can't be a flag or -- – -M --text --yes no longer rewords to "--yes" – and a word running on past a flag's name is an unknown option
  • --continue, --skip and --abort refuse a commit or mode beside them
  • An --exec result the command builds on a commit below the starting tip – a reset there, then new commits – needs --base, as one built before the run already did
  • A new -C path inside the checkout refuses unless git ignores it there
  • A resolution that takes in what a later commit changes refuses, naming that commit, and a reorder or --move ending on another tree refuses, naming the files, where 1.7.0 printed a note and landed
  • A resume refuses where a commit was taken out of a paused replay by hand, or stepped over with a raw git rebase --skip whose change the replay lacks – an emptied step, which 1.7.0 said to skip by hand, now drops at --continue
  • --carry refuses while a merge, rebase, cherry-pick or revert is in progress in the checkout
  • --allow-new-path no longer lets a removal fold below the commit that adds its path
  • --onto beside --undo, --carry or --status refuses, as does a run outside a repository
  • A run whose branch another session paused on while it ran refuses at its landing

New

Isolated runs

  • The in-place rebase and its stash are gone, and with them their failures: ignored files overwritten, a merge in progress turned into a plain commit, staged changes unstaged by the pop
  • A terminal's edit, drop or squash lands as an agent's did – by compare-and-swap, journaled for --undo, checked by a configured gate
  • An --exec command runs in the worktree's copy of the directory you call from, GIT_PREFIX naming it. One that leaves a rebase, merge or pick stopped partway lands nothing, and one naming a program the tip lacks refuses before it runs

At a terminal

  • Every pause asks: Enter resumes it, staging each conflicted file you cleared of markers, Escape twice cancels, q or Ctrl-C leaves it for later
  • GIT_EDIT_ACTOR set, or output not to a terminal, makes a run an agent's – a pause exits for --continue, its checkout coming along all the same

Your checkout – the README has the rest

  • Once a run lands – any mode, an undo included – the checkout it started in comes along: untouched files take what landed, your edits merge onto it, and a file, directory or symlink of yours standing where something lands is kept and named
  • A merge that conflicts writes nothing, as the edits may be another session's – the git merge-file line that brings the markers in is named for whoever owns them
  • A checkout remembers the tip it last came along to, so a bare git edit --carry – or the next landing – brings every landing it missed, none twice, a branch switch, a git stash or an upgrade from 1.7.0 in between too
  • Where the sync can't run, the run names that git edit --carry, and --status names a checkout left behind with what brings it along

Committing from a shared checkout – the README has the rest

  • git edit --commit --text <msg> -- <paths> commits files as they stand, as git commit -- <paths> does, composed apart from the shared index, and --amend-into=<sha> --whole -- <paths> folds them
  • Where a file also holds another session's uncommitted lines, --edits, --patch, --put, --rm and --chmod compose the commit or fold from your own changes alone, on the tip's content in a private index
  • Each refuses to take back what another caller landed in the last 7 days, naming the landing and the remedy – --base=<sha> where taking it back is the point
  • --after=<sha> or --before=<sha> lands the commit beside that one instead of at the tip, in the same run – --exec takes them too

Sessions sharing a branch

  • A run whose branch moved since it read it stops before it pauses, runs its gate, resumes or lands, naming who moved it, rather than pausing for a resolution that could never land or running a suite for nothing. --status names the abort and redo such a pause needs
  • A pause wins over a run already in flight on its branch: that run refuses, naming whose pause it is and to rerun with --wait=600, so the pause's finished resolution still lands
  • A pause on one branch no longer blocks --exec or --undo on another – an undo refuses at once, naming whose pause it is
  • A labeled caller's pause is its own – another label's --continue or --abort needs --allow-other-actor – and a resume whose pause another run ended meanwhile lands nothing
  • A run killed after moving its branch, journaling nothing, is journaled by the next run, which re-syncs the index entries it stranded
  • The README and man page gain "Many sessions at once": where many sessions fold into one deep history, land each fix at the tip as a fixup! commit, then squash them in one session at a time

Resumes and the suite

  • --continue stages each conflicted file whose markers you removed and names them – a file git gave no markers is named with the git add or git rm that stages it
  • The suite is a selftest/ folder of one file per scenario beside the script, run side by side with --selftest --jobs

Fixed since 1.7.0

  • -d nope..HEAD – a range whose start names no commit – dropped every commit on the branch
  • A commit made on top of the edited one at an edit's stop landed in place of every commit above it
  • A drop could take every commit of a branch, and a drop, edit, squash or --exec ran on a detached HEAD
  • A rebase quit by hand in a pause's worktree landed its partial result, and a conflict marker committed there landed too
  • -C reset a path halfway through a rebase or merge, another run's path, or another repository's work tree
  • --amend-into and --split read a path with pattern characters as a pattern – app/[id].tsx took app/i.tsx along
  • --carry merged only the files holding edits, leaving the rest of the checkout stale – a removed file, an added one, a link – and a bare one took the last rewrite alone
  • A landing offered a git restore for the files it left stale, which, run later, takes an edit another session made since
  • Enter at a terminal pause ran git add --all, conflict markers included
  • A second --undo of the same run took back the run before it, and an undo could take pushed commits off the branch
  • A reword re-read the tip after its editor, so a commit landed and taken back meanwhile could ride along
  • A rebuilt commit now keeps its author line and message byte for byte – a missing last newline, trailing blank lines, a -0000 zone – the editors follow core.commentChar and commit.cleanup, and a message typed for a run then refused is kept in a file the refusal names
  • A resumed fold that changed nothing ended ok, where a first run refuses
  • A hook vetoing an amend or a landing read as "Unknown error" or a move during the rebase
  • A temp worktree ignored the config your checkout reads – an onbranch include's identity or signing key, a relative core.hooksPath such as husky's
  • A file committed with CRLF under eol=lf or text blocked a pause, replay or replant
  • A caller's git config, GIT_DIFF_OPTS or GREP_OPTIONS could change git-edit's checks – and a GIT_DIR or GIT_INDEX_FILE naming another repository is refused now
  • A GIT_EDIT_ACTOR label with characters beyond letters, digits, _ and - was dropped – it is kept now, mapped to _ in the reflog
  • A reader going away – | head – stopped a run before it landed
  • A tag left on a rewritten commit ...
Read more

v1.7.0

Choose a tag to compare

@thomasbachem thomasbachem released this 04 Oct 13:16

A fold deep under later changes now stops once per distinct content instead of at every later commit, uncommitted edits can follow a rewrite onto its new content, and a scoped fold of a non-ASCII path no longer commits a stray file.

A fold into a commit far below later changes to the same lines used to stop at each later commit that touched them, every stop a state written by hand. --amend-into=<sha> --snapshot merges the fold into every commit from the target up instead, through git merge-tree against the tip as base, so a file moved since takes the fold under its old name and each commit keeps its author and message. A conflict stops once per distinct content of the conflicted file, in a worktree laid out as any merge's: resolve it, git add, git edit --continue, and that resolution serves every commit carrying the same content, while rerere pre-fills a hunk resolved at an earlier stop. On a real fold 415 commits deep it stopped 7 times and rebuilt every commit exactly as a hand-built history had. Only conflicts over content resolve this way, and it needs git 2.40 or later.

A landing that changes files carrying uncommitted edits now names those whose edits sit on the old content – committed as they stand, they would take the rewrite back – and a renamed file whose edits stayed at its old path, where it used to offer a restore of the new path that stranded them. The git edit --carry=<old tip> it prints merges those edits onto the new content, writing only clean merges that keep the edits whole and naming the rest. It never runs on its own, since a rewrite that took content out of history hands it back as uncommitted work, which the merge would take out again.

A scoped fold – --amend-into=<sha> -- <paths> – of a path with non-ASCII characters read git's quoting of that path back as a name, committing a file called "\303\234ber.txt" beside the real one and leaving the real one unfolded. Paths now pass through as their own bytes.

With GIT_EDIT_ACTOR set, --undo refuses a run made under another label, or none, unless --allow-other-actor says it is meant: the journal is the repository's, so its last run can be a parallel session's on any branch. A landing that rewrote pushed history prints the push that publishes it, its --force-with-lease pinned to the upstream the rewrite replaced, since a background fetch would otherwise move the remote-tracking ref under a bare lease. And a -C worktree whose folder vanished is reclaimed alone, where a repository-wide git worktree prune also deleted the records of every other worktree whose folder was gone.

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.

v1.6.0

Choose a tag to compare

@thomasbachem thomasbachem released this 04 Oct 07:53

Parallel sessions can no longer overwrite each other's pauses, and --amend-into folds into a commit that had the file under an older name.

A repository holds one pause at a time, and every mutating mode refuses while one is open. That check runs as a run starts, though, so a run reaching a conflict, a failed check, a split or an edit pause after a parallel session's had been recorded wrote over it: the first session's worktree was left behind, and its --continue picked up the other run's pause or found none. Such a run now refuses as in flight, as it would have at the start, removes the temporary worktree it made and leaves the other pause as it was. A worktree named with -C stays.

A run that failed while a parallel session's pause was recorded also kept its own temporary worktree, taking that pause for its own, so worktrees piled up where sessions overlapped. A failed run now keeps one only for a pause of its own. Leftovers from earlier versions can go with git worktree remove – any git-edit-* worktree that git edit --status doesn't name.

--amend-into refuses a staged path its target doesn't have where a later commit introduces it, since folding beneath that introduction makes every later commit touching the file conflict. A path that was only renamed since was refused the same way, though the fold's replay carries the change to the old name. Such a path now folds onto its old name wherever git's rename detection pairs the two as that replay will, and a note names the old path. A staged deletion of such a path, or a rename git can't pair, is still refused.

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.

v1.5.0

Choose a tag to compare

@thomasbachem thomasbachem released this 01 Oct 05:47

The verify gate now checks where a move or reorder is most likely to have broken a commit it never touched, and a run that has already moved the branch finishes through a signal instead of dying halfway.

A move or reorder used to verify only its tip, so a commit carried below a file its own check needs landed green whenever the tip still held that file. The default tier now also checks each commit a move or reorder puts directly below one that came before it: a commit moved down where it lands, and for a commit moved up, the commit it lands on. Every commit it jumped over that needed it keeps failing until it reappears, so that one check stops the run whichever of them broke, and the report names the moved commit as the first one above that passes again. A plain --reorder gets the same check, worked out from the old order and the new one.

Every mode now also checks the first commit it rebuilt, which a commit moved up or dropped leaves without what sat below it, and each commit a conflict resolution wrote, since git replayed the rest and a later commit can heal a wrong resolution before the tip ever shows it. The verification line says how many of the commits it ran were resolved at a stop. A replant counts only what it built, leaving out the commits its new upstream brings.

Quitting an app that started git edit – a Git GUI, an editor – takes away the reader of its output, and the run used to die on the next write without cleaning up, leaving its worktree registered. A lost reader now stops a run before the branch moves the way SIGHUP, SIGINT and SIGTERM do, and it exits 141. Once the branch's update-ref has begun, a run finishes instead – the journal entry --undo reads, the rewrite delivery and the index re-sync all still happen – and exits 0 with a line above its trailer naming the signal. A second SIGHUP, SIGINT or SIGTERM still stops it at once, with a trailer naming the move for git edit --undo.

Some checks fed text through a pipe into grep -q and missed what they looked for once it outgrew the pipe buffer, since grep exits at its first match and the writer it leaves behind fails the pipeline. --continue now refuses a staged resolution that still carries conflict markers whatever its size – from about 40 KB the markers could pass unnoticed and be committed. A batch reword of --- <commit> records is read as records however long it gets.

GIT_EDIT_ACTOR closes every reflog entry git edit writes with a label – git edit: reorder 1a2b3c4..5d6e7f8 [ci-nightly] – so a history viewer can name who moved the branch. --exec's reflog entry names the oldest commit it replaced, as the other modes name their target.

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.

v1.4.0

Choose a tag to compare

@thomasbachem thomasbachem released this 28 Sep 06:41

--exec can now show a result before landing it, and refuses two ways a scripted rewrite used to land wrong while reporting ok.

--dry-run builds the result in the same isolated worktree and stops there. It names the tip the result was built on and the git range-diff that compares the two, and leaves the result addressable by SHA, with nothing verified or applied. The last line before the trailer is the landing, pinned to that tip:

git edit --exec --base=<tip> -- git reset -q --hard <sha>

It refuses if the branch moved in the meantime. Inspect a scripted rewrite this way rather than by running the script outside --exec, where the closing reset --hard that hands its result back moves the shared checkout's branch and discards its working tree. A verify flag on a dry run refuses, since the gate belongs to the run that lands the result.

--base=<sha> names the tip a result was built on. The compare-and-swap covers the command's own run and nothing before it, so a history built earlier – elsewhere, then landed with git reset --hard – said nothing of the tip it started from: whatever reached the branch meanwhile left with the rest, and the run still reported ok. A result carrying a commit made before the run now refuses where it takes commits off the branch, naming the newest of them, unless --base names the tip it was built on. Where the branch has moved past that tip, the run refuses before the command starts, naming what arrived since and the git rebase --onto that carries it onto the result inside the run. A descendant of the tip lands as ever, and so does anything the command builds itself. A rebuild that keeps its commits' original committer dates reads as built before the run, though, and now needs --base at the current tip – a run that used to land and now refuses, which is what the minor version says.

A result whose messages end in more blank lines than the commits they replace refuses too, naming them. It is the mark of a rebuild loop reading a message with %B and handing it to commit-tree unchanged: each pass adds a blank line to every message it rebuilds, and neither git log nor git range-diff shows it. Commits are matched by subject, or by author and author date, which a reword keeps, and one brought in from elsewhere replaces nothing and lands as it was. A loop that carries a message byte for byte, or trims it, passes.

A checkout file left at the new tip's content under another mode – an executable bit lost to a file moved into place – is now named apart, both modes given, with the chmod that matches the commit. It used to be listed as carrying uncommitted edits, which on a file just committed whole invites committing "the rest". A fold and --exec reconcile the checkout the same way.

--selftest=<ids> runs picked scenarios – --selftest=83-87,90, an open end running to the suite's own – together with any a scenario names in a # needs mark, and its trailer says what ran. It is meant for development: the scenarios share one repository, so a pick proves only what it ran, and a commit or a release takes the whole suite.

On a terminal, or where GIT_EDIT_PROGRESS is set, the verify gate now names each commit as its check starts – Checking 2 of 5 – <sha> <subject> – so a long gate can be followed. A captured run stays as it was, as a line per commit would only fill output read after the fact.

A run stopped by SIGHUP, SIGINT or SIGTERM now cleans up as a failed run does and exits 129, 130 or 143. It used to leave its worktree registered behind, out of --abort's reach. A signal that arrives after the branch moved names the move in the trailer – stopped by SIGTERM after refs/heads/main moved <old> → <new> – which git edit --undo takes back, and a --continue stopped after it landed no longer stays paused.

The man page's snapshot-map recipe now covers carrying each commit's message and author date, and the hand-authored fold whose replay stops at every later commit that rewrote its lines: map that fold instead, as edits every snapshot from its target up matches exactly once.

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.

v1.3.0

Choose a tag to compare

@thomasbachem thomasbachem released this 23 Sep 06:12

A standing edit.verifySpan used to give a single run two prices: every rebuilt commit, or --no-verify. A one-line fold 108 commits deep ran the suite 108 times – seven minutes, the fold itself instant – and the caller learned that from the output, after the fact.

--no-verify-span steps one run back down to the default tier – the primary commit and the tip – where --no-verify would skip the check altogether. A pause keeps the declined tier for its resume, and the flag is refused together with --verify-span.

A caller picks its flags before running, so the price that can reach it in time is the previous run's. The Verified line now carries what the whole check took, and under a standing edit.verifySpan what the tier ran beyond the default one, with the lever named – the mirror of the default tier's own line, which already names --verify-span for the commits it left unchecked:

Verified 108 commit(s) with `npm test` in 412s – 106 beyond the default tier, `--no-verify-span` runs only its 2 (set by edit.verifySpan)

A run that asked for the span with the flag chose the cost, and hears nothing extra.

A verify flag given on --continue now sticks to the operation as it would on the first invocation – --verify=<cmd>, --verify-span and --no-verify-span alike. Before, a re-pause on a resume kept the state file as it stood, so the next plain --continue fell back to the original command and tier. A span tier asked for on a resume with no command in hand is refused before anything is rebuilt rather than recorded, since recorded it would refuse every later resume, and a multi-line --verify is refused up front, since a conflict pause persisted it truncated before any gate saw it.

--move takes several commits. Given more than once, it moves every commit it names to the anchor as one block, in their history order and in one replay – where moving them one at a time replayed the span, and under a standing edit.verifySpan verified it, once per commit. Commits lying between them stay where they are, so a commit another session landed in between is left alone. A value can also name a run, <oldest>..<newest>, both ends included. And a move right above the last pushed commit no longer asks for --allow-pushed: its anchor is never rewritten, but the pushed guard read it all the same.

An option that takes one value – --amend-into, --split, --onto, -s=, --after, --before, --tree, --text, --verify, -C/--dir – refuses to be given twice. The parser kept one value alone, so a fold given two targets landed on the second without a word, and a second --verify dropped the first check.

One fix: GIT_EDIT_VERIFY_COMMIT, documented as naming the commit under test, was never exported – a prefix assignment on the eval builtin does not reach the child it forks – so every verify command saw it unset. It reaches the command now, at the gate, at the counterpart run and on the climb, and a selftest insists on it.

emulate zsh now opens the script, with unalias -a behind it. zsh sources a caller's .zshenv for every script, so a setopt sh_word_split or an alias grep='grep --color=always' there ran a different tool than the selftest proves – the alias put a color escape into a parsed SHA. Every option that changes parsing is back at zsh's default, aliases are cleared, and the reorder mode's sequence editor, which git starts as a shell of its own, runs under sh. One consequence: a .zshenv alias no longer resolves as a verify command – a function or a script does. Functions stay, a git () wrapper there being deliberate.

Re-cut four times: on 22 September with the resume paragraph, then with the .zshenv hardening, and twice on the 23rd, with the moves and the first repeat refusals, then with those refusals extended to every option taking one value – none of which the earlier cuts carried.

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.

v1.2.1

Choose a tag to compare

@thomasbachem thomasbachem released this 22 Sep 12:04

Two silences the output used to keep: a verification gate that was skipped, and a branch left behind in a rewritten span that another worktree has checked out.

--no-verify now says what it skipped:

Verify skipped – --no-verify was passed, so `npm test` never ran
git-edit: ok – refs/heads/main moved 79247e47 → 3ccbcab2

Before this, that run and a run in a repo with no edit.verifyCmd at all produced byte-identical output – both printed the trailer and nothing else – so a reader could not tell a gate that was bypassed from a gate that never existed. Silence now means only the second. It matters most on --no-verify --continue, the documented way to apply a result the gate rejected: that run names the check it overrode, taken from what the pause recorded rather than from the config.

The line joins the gate's own family, so one grep -E '^(Verif|git-edit:)' still answers what landed and what checked it – three characters wider than before, and it picks up the per-commit skip note as well.

A branch that points into a rewritten span is named at the landing so it can follow the rewrite. One checked out in another worktree was skipped without a word, though it sits on pre-rewrite history exactly the same way – and that is the case where somebody may be working in it right now. It is now named with its counterpart, and deliberately without a command:

Branch feature points into the rewritten span, checked out in /path/to/wt – that checkout's to move:
  its counterpart here is 4dabdbdff249  # same change: Commit B

Moving a branch someone else has checked out belongs to that checkout, over whatever work is sitting in it.

Both are additions to what a run reports – nothing changed about what lands, or about when a run refuses – which is what the patch version says.

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.