21 ms·
For those who resonate with "why might this be useful", here are "plain git" alternatives to this tool: > searching for a function I deleted git log -G so
by mbakke 3y ago
For those who resonate with "why might this be useful", here are "plain git" alternatives to this tool:
> searching for a function I deleted
git log -G someFunc
> quickly looking at a file on another branch to copy a line from it
I use `git worktree` to "mount" long-running branches much to the same effect as Julias tool. To quickly look at a file from a non-mounted branch/commit, I use:
git show $REF:$FILENAME
> searching every branch for a function
git log --all -G someFunc
Note that -G can be replaced with -F for a speedup if the pattern you are searching for is a fixed string.
- masklinn 3y ago> searching for a function I deleted > git log -G someFunc This will look for all changes mentioning someFunc throughout the history of the project. Usually -S is more valuable, as it will look for changes in occurrence counts. So if you moved a call in a commit -G will flag it, but -S will ignore it (+1-1 = 0). -S also defaults to fixed string, so no need for -F. Instead you need —pickaxe-regex to switch it to regex search.
- tambourine_man 3y agoIf you’re a Vim user, fugitive by tpope is a great tool
- levidos 3y agoExtremely handy, saving these. Thank you.
- globular-toast 3y agoMagit has a really easy to use way to "step" through previous versions of files. It's usually bound to something like "C-f p". You get a read only buffer of the previous version open in the best text editor (emacs). You can then press n and p to step through next and previous versions of that file. Can be pretty useful! It's kind of funny, I think, how most git users don't seem to know how to access any version other than the current one. So many people think of it simply as the annoying tool you have to use to make code changes but don't really know what version control is.
- divbzero 3y agoThat’s a pretty cool feature of Magit. I was inspired to look for something similar for the next best text editor (vim) and came across this: https://salferrarello.com/using-vim-view-git-commits/ https://salferrarello.com/using-vim-view-git-commits/ git log | vim -R - Placing your cursor over a commit hash and entering K displays git show for that commit.
- cnity 3y agoIf you're not using neovim you're really missing out right now IMO. It's a renaissance for a hackable text editor because it uses a sensible modern programming language (Lua) rather than vimscript (yikes) or elisp (eh).
- globular-toast 3y agoYou may be missing the point of Elisp. Elisp isn't an "extension language". It's the language Emacs is built with. When you run Emacs you're actually running a Lisp interpreter with a load of text editing features pre-loaded. When you eval some Lisp you're modifying the runtime, essentially live patching your editor in real time. So really any comparisons with Elisp are irrelevant unless you can do what it can do. Common Lisp and Scheme (Guile) are real contenders but the challenge is not giving up the enormous amount of useful code that is already written in Elisp.
- galangalalgol 3y agoDoes the elisp interpreter that runs emacs have jit?