Git checkout lets you cancel the changes for a file: ]įinally, the last part of the config file is the. The git add on ctrl A is added with this verb definition: ] This assumes the difftool has been configured on your system. I prefer to be able to navigate in the usual broot way. The apply_to attribute prevents this behavior to apply to directory. Next we add the command for diffing a file on enter: ] If $EDITOR isn't defined for you, you may directly write the path to your favourite editor. cols_order = " scdgbn "įollowing are the verb definitions (see related broot documentation if you want to know more).įirst the shortcut for edition: ] The ones which really matter for us are d (date), g (git status), b (branch), and n (file name). You may swap chars in this string to better understand. The cols_order line specifies the column order. We could have alternatively added -hd to the function's command. The default_flags line tells broot to start with the hidden files visibles, and to show the date. If it doesn't work yet, or if you want to know how it's done or to customize the installation, please read along. If you just want it to "work" and it does, you may stop here. Now, the gg command will get you something similar to the screenshot illustrating this post. If necessary, load the function: source ~/.bashrc The first one tells it to use our specific config file while the other one starts it in "git-status" mode. This command launches broot with two arguments. My solution is to add a function in ~/.bashrc : # git diff before commitīr -conf ~/.config/broot/git-diff-conf.toml -git-status We'll create a specific config file so that we can launch broot in a dedicated "git diff" mode without messing with the standard usages.Ĭreate the git-diff-conf.toml file along the default one (in ~/.config/broot on linux), with this content. Installationįirst, if you don't have it, install broot and maybe take the time to learn what it is. This blog post first tells how to configure broot to get this interface, then explains how it works. I hit ctrl A to do a git add of the file.I hit ctrl E to edit the file (this launches vi and when I quit it I'm back here).I hit enter to open meld on the selected entry. I navigate either by typing a few letters of file names or more usually simply with the up and down arrows.Only the new and modified files are listed, along with their status and modification date. So, now I type gg which gets me this broot based TUI: While I like scm-breeze for most git related operations, I don't find it convenient enough for this specific kind of review. And usually there's a few last things to fix, mainly comments. Before every commit, I do a short review of what I wrote.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |