Lurker News

Comments (229) 38 threads

Earlier comments
kbumsik1 reply#
I use VS Code and GitLens lately. VSCode’s diff view and GitLens explorer cover my needs very well.
swozey2 replies#
Gitlens is incredible. I can't believe none of my coworkers I ever mention it to have used it.
roryisok#
It really is amazing. To be able to mouseover a line of code and see who committed it, link to the commit and see what it was before... It saves so much time
sv1231 reply#
The CodeLens feature in VS2017 is really similar, it's the only reason we pay for the pro license instead of just using community edition.
h1d#
It's hard to believe MS still charges people who are making their platform more worthy and with competition from Jetbrains.
stockkid5 replies#
Personally I have been typing all git commands manually into the terminal and never felt a need for GUIs or tools such as this.

There are a number of git shortcuts defined in my zsh aliases [0]. It goes like:

  # Git aliases
  alias g='git'
  alias ga='git add'
  alias ghb='git browse' # hub
  alias ghpr='git pull-request' # hub
  alias gp='git push'
  alias gpoh='git push origin HEAD'
  ...

Using these aliases, we rarely have to type more than 3-4 characters for a git command. Savings and efficiency not only add up over years of using git, but also accelerate as you become more proficient in using your own aliases that fit your special needs.

[0] - https://github.com/sungwoncho/dotfiles/blob/master/zsh/alias...

mehrdadn#
Also simple but very handy:

  [alias]
  	amend = commit --amend --no-edit
  	ls = ls-tree --name-only --full-name HEAD
  	tree = log --graph --decorate --oneline --all
  	commit-date = "!gitcommitdate() { (export GIT_COMMITTER_DATE=\"$1\" && git commit --date=\"‎${GIT_COMMITTER_DATE}\" \"${@:2}\"); } && gitcommitdate"
There's also a whole boatload of commands in git-extras for those interested: https://github.com/tj/git-extras/blob/master/Commands.md
mlthoughts20181 reply#
I personally prefer to use a combination of a foot pedal and eye tracking cameras to enter a Reed-Solomon code of taps and blinks uniquely mapping to git commands.
roryisok1 reply#
I think I've met you at a conference. Were you the guy blinking U-S-E-V-I-M on Morse code during conversations

Continue this thread — 1 reply

jordigh2 replies#
With Mercurial, I like that all commands can be abbreviated to their shortest unique prefix, plus some built-in aliases. So I type a lot of `hg up`, `hg pus`, `hg ci`, `hg pul`, `hg bo`, and so forth. Most of these are almost the same length as your aliases.

Whenever I have to touch git and `git co` doesn't work, I think, okay, fine, we'll go through the full dress rehearsal; `git checkout` it is.

h1d#
Hard to believe how git doesn't have them by default.
muxator#
Plus, actually sane command names, and super powerful functionalities (for example, answering to another comment, you always could "hg blame (annotate)" an arbitrary version of a file without having to check it out first)!
__blockcipher__#
I've been playing around with hub recently, but ended up commenting out the "source hub alias" line because a) since I use aliases, you might as well be explicit, b) I'm tired of having to pipe my aliases to `sed 's/hub/git/g'` when I do `which my_git_alias` to send to other people, and c) I don't want to support github conflating the two when it's not that hard to remember which does what even if you don't use aliases.

Another tip, I only occasionally need git autocompletion withh aliases, but in zsh you can do something like this:

  # Enable zsh git completion for our aliases.
  # See     https://github.com/mislav/dotfiles/blob/d82e79b8a500891a02ab28171974d68be7a35e12/shrc/git.sh
  if [ -n "$ZSH_VERSION" ]; then
    compdef _git g=git
    compdef _git gc=git-commit
    compdef _git gco=git-checkout
    compdef _git gd=git-diff
    compdef _git gb=git-branch
    compdef _git gst=git-status
    compdef _git gp=git-push
    compdef _git gd=git-diff
  fi
And obviously bash has an equivalent.
kccqzy1 reply#
Magit is great but it's just so incredibly slow at big repos. For certain things like Instant Fixup magit is still faster than the command line but most of the time I can do it much faster via the command line. Sometimes I'm not even sure whether magit is just slow or my emacs hangs.
Pimpus2 replies#
Please post your OS and Emacs version.

Magit hasnt been slow for me since I upgraded to Emacs 26. Older versions of Emacs were not optimized for spawning processes on OSX and it was causing a 10x slowdown for some operations.

kccqzy#
I'm using the latest version of both.

Actually magit is quite fine for small personal projects. It's just that it absolutely chokes on a large monorepo I'm working on.

kccqzy1 reply#
Perhaps I should revise my statement. It isn't magit itself that's slow, but rather magit is calling out to slow git commands. And while those git commands are taking up 100% of my CPU, Emacs itself is using 0% CPU and totally unresponsive.

Just a few moments ago I had to kill Emacs because magit was executing this command:

    git branch --remote --contains 10a1663bf96f

Continue this thread — 1 reply

was_boring1 reply#
Thanks for making this, it looks great! I'll be giving it a shot tomorrow.

I've been moving more and more to terminal for all of my development. My dev. stack is now: vim; tmux; lynx; ddgr; zsh; and docker. It is game changing for distraction-free programming, consistency between languages, and the ability to use the exact same setup everywhere -- even on remote machines.

h1d#
We need CLI to work on repo on remote servers. I was using tig but didn't like it for lack of ability to easily navigating file tree on each commit and this seems better.

Load more comments