sjurba / rebase-editor Goto Github PK
View Code? Open in Web Editor NEWSimple terminal based sequence editor for git interactive rebase.
Simple terminal based sequence editor for git interactive rebase.
On Ubuntu 18.04, pressing Shift + [UP, RIGHT, DOWN, LEFT] quits and exists the rebase with the message:
Nothing to do
I can't get stdin.setRawMode(true) to work with Mingw which is the terminal used in Git-bash included with git on windows.
Any help, suggestions or workarounds on this issue are very welcome.
Have you found a way to use rebase-editor to work on windows with another terminal? Please let me know here.
When -c is the last option and there are no colors specified, the argument parsing gets confused.
$ GIT_SEQUENCE_EDITOR="rebase-editor -c" git rebase -i master
No input file specified.
Could not execute editor
These cases work as expected.
$ GIT_SEQUENCE_EDITOR="rebase-editor -c -s" git rebase -i master
$ GIT_SEQUENCE_EDITOR="rebase-editor -c ^r,^y,^b" git rebase -i master
My current configuration is below:
editor = rebase-editor -c "^M,^G,^g" -m "^#^Y"
and the result is as this image:
But I want the marker style to be merged into color
styles, that is, it is desirable that text colors of marked texts should be bright magenta, bright green and green and their foreground colors should be yellow at the same time, as below:
Can I do that? Or I request this specification.
It seems Windows has problems with the ansi inverse command.
Will try to make a workaround asap.
If you enable colors you can see what is going on:
git config --global sequence.editor "rebase-editor -c"
When capturing with stdin.setRawMode(true) it doesn't return anything for those keys on Mac.
If you want to see for your self, configure rebase-editor -s
to get a status bar on top that show exactly what keys are pressed..
Any help or suggestions on this issue are very welcome.
In the mean time we have to settle with using Left and Right..
When using editor-config it's not possible to use the Reword or Interactive Rebase from IDEA any more. On the console there is following error:
git -c core.quotepath=false -c log.showSignature=false -c core.commentChar=� rebase --interactive --rebase-merges --no-autosquash 2a1...987
Not a proper rebase file:
label onto
reset onto
pick 8a4de21 <message>
pick 41d0918 <message>
...
error: There was a problem with the editor 'rebase-editor'.
Is there any chance this could be fixed?
Running Node 6.13.0 on ubuntu 18.04, got the following error:
node_modules/rebase-editor/node_modules/string-kit/lib/format.js:624
base = round( n / ( 1000 ** logDiv3 ) , roundStep[ logMod ] ) ;
SyntaxError: Unexpected token *
Since node 6 is officially supported, I think this is a bug.
I've installed rebase-editor on Linux Mint 18 Sarah by typing:
sudo apt-get install npm
sudo npm install -g rebase-editor
git config --global sequence.editor rebase-editor
When I run interactive rebase I receive following error:
/usr/bin/env: ‘node’: No such file or directory
Could not execute editor
I fixed that by runing (as suggested on some forum)
ln -s /usr/bin/nodejs /usr/bin/node
And now I got:
~/source/hardware $ git ireb HEAD^^^^^^^^^^
/usr/local/lib/node_modules/rebase-editor/node_modules/terminal-kit/lib/ScreenBuffer.js:1495
ScreenBuffer.prototype.CLEAR_BUFFER = Buffer.allocUnsafe( ScreenBuffer.prototype.ITEM_SIZE ) ;
^
TypeError: Buffer.allocUnsafe is not a function
at Object.<anonymous> (/usr/local/lib/node_modules/rebase-editor/node_modules/terminal-kit/lib/ScreenBuffer.js:1495:46)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/usr/local/lib/node_modules/rebase-editor/node_modules/terminal-kit/lib/termkit.js:48:24)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
Could not execute editor
How should I proceed?
From the interactive rebase commands:
# f, fixup [-C | -c] <commit> = like "squash" but keep only the previous
# commit's log message, unless -C is used, in which case
# keep only this commit's message; -c is same as -C but
# opens the editor
Currently, there is no option/keybind to allow us to choose one of these flags when we are using fixup. Will look into creating a keybind for the fixup command, I.e. CRTL-F -> fixup -c
and SHIFT-f -> fixup -C
I've tried to use color mode using this:
$ git config --global sequence.editor "rebase-editor -c"
but afterwards rebase doesn't work anymore:
$ git rebase -i upstream/master
No input file specified.
Could not execute editor
Cut and paste a couple of lines. Then try to change the action of those lines (squash, fixup, reword, etc).
It may fail throwing some exception.
Just a suggestion that syntax highlighting would be nice. vim normally does this for me and it's the one thing I'm missing after trying rebase-editor. I may try to hack together a PR myself with some simple colours.
Git added a new rebase feature: update-refs
https://github.blog/2022-10-03-highlights-from-git-2-38/#rebase-dependent-branches-with-update-refs
When I run a large rebase operation with a long list of commits I can't edit the commits at the bottom since the editor doesn't seem to support scrolling at the moment.
Also tried with -c and with --no-alternate-screen options - it didn't help.
I always catch myself on "I have done everything -> Enter!" and then "Oh no, it's Q" 😃
You should be able to create a ~/.rebase-editor-bindings.json file that will contain your custom key bindings.
For some reason, the JSON file with keybindings is not being parsed properly. Here's the error message:
$ git rebase --interactive 05ce24982865b1fbedc9f3076cfe4960a0482b5f
/Users/brandon/.rebase:2
"j": "down",
^
SyntaxError: Unexpected token :
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:528:28)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at module.exports (/Users/brandon/.config/yarn/global/node_modules/rebase-editor/lib/key-bindings.js:6:18)
at module.exports (/Users/brandon/.config/yarn/global/node_modules/rebase-editor/lib/main.js:17:18)
Could not execute editor
This happens whether I list only my own keybindings, or only the defaults, or both.
Here's the relevant line in my .gitconfig
:
editor = rebase-editor --status --color --marker '^Y' --keys ~/.rebase
And here is my ~/.rebase
file:
{
"j": "down",
"k": "up"
}
These are all the commands available when rebasing (in German):
Befehle:
# p, pick <Commit> = Commit verwenden
# r, reword <Commit> = Commit verwenden, aber Commit-Beschreibung bearbeiten
# e, edit <Commit> = Commit verwenden, aber zum Nachbessern anhalten
# s, squash <Commit> = Commit verwenden, aber mit vorherigem Commit vereinen
# f, fixup <Commit> = wie "squash", aber diese Commit-Beschreibung verwerfen
# x, exec <Commit> = Befehl (Rest der Zeile) mittels Shell ausführen
# b, break = hier anhalten (Rebase später mit 'git rebase --continue' fortsetzen)
# d, drop <Commit> = Commit entfernen
# l, label <Label> = aktuellen HEAD mit Label versehen
# t, reset <Label> = HEAD zu einem Label umsetzen
# m, merge [-C <Commit> | -c <Commit>] <Label> [# <eineZeile>]
# . Merge-Commit mit der originalen Merge-Commit-Beschreibung erstellen
# . (oder die eine Zeile, wenn keine originale Merge-Commit-Beschreibung
# . spezifiziert ist). Benutzen Sie -c <Commit> zum Bearbeiten der
# . Commit-Beschreibung.
The b
, l
, t
and m
keys do not do anything.
git rebase -i HEAD~2
hint: Waiting for your editor to close the file... /usr/local/lib/node_modules/rebase-editor/lib/reducer.js:148
return state.lines[pos]?.action
^
SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/usr/local/lib/node_modules/rebase-editor/lib/main.js:3:12)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
error: There was a problem with the editor 'rebase-editor'.
Line 148 in 1592548
I could edit by vim.
Apparently, lots of people find the alternate screen to be evil. I have no problem with it but since some do, I figured we might as well add a switch to disable it.
You might argue that you shouldn't need to configure the app specifically for this, that I should respect some global term config and figure it out on my own. But, ain't got time for that shit. But maybe terminal-kit does, so if you want that fixed, take it up with him. I think that titeInhibit
will work, what ever that means.
But a simple switch to disable it from my app, that I can do:
--no-alternate-screen
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.