Live data from Hacker News

Magit, the magical Git interface (2017)

emacsair.me

241–250 of 357 posts

Re: Magit, the magical Git interface (2017)

#241

I've never seen the upside. I use Emacs as my primary editor, and I regret it every time I say "today is the day I start using Magit". It is exceedingly invasive, triggering itself even when you don't ask for it (like running "git rebase -i" on the command line). The invasive stuff changes how the text editing itself works, but doesn't add deep features. In the interactive rebase case, I lose the ability to treat the…

> So I wonder what marketing techniques they use to make people feel this way; the emotions are strong, and widely shared.

It's easy. 1) Listen to the fans when they suggest a feature even if it doesn't click when first hearing about it, but then approve upon the initial suggestion, turning it into something I myself would want to use too.

2) Ignore the haters except for telling them how to disable that one feature that is so abhorrent it makes the whole tool unusable:

  (with-eval-after-load 'git-rebase
    (setq auto-mode-alist
          (delete (cons git-rebase-filename-regexp 'git-rebase-mode)
                  auto-mode-alist)))

Re: Magit, the magical Git interface (2017)

#242

Earlier quoted context omitted.

What I dislike with git terminal UI is that commands reflect the innards of git, not what the user wants to do. It also forces a deeper understanding of the innards for basic commands than ought to be necessary. Examples where undoing an operation looks totally different to doing it: - To stage a change you `add` it, to unstage you `reset HEAD` - To commit you `commit`, to undo a commit you `reset --hard HEAD^` The l…

“ - To commit you `commit`, to undo a commit you `reset --hard HEAD^` The last example is also where you get pointed to an unsafe command” Who pointed you there? If I want to undo my last commit, meaning the commit itself, not the changes to my file tree, shouldn’t I say `reset --soft`?

I've been using git for ~8 years and I've never heard of --soft

Re: Magit, the magical Git interface (2017)

#243
post #112

Earlier quoted context omitted.

I just called the status buffer from magit on a repo. It was 23 calls to git, mostly for rev-parse. The status buffer appeared instantaneously on a decade-old laptop. Whatever is causing the slowness you're seeing, I don't think it's just because of the number of calls. It's probably the slowness of one or two specific commands, perhaps due to repo size.

Try opening the status buffer on a project with 50+ submodules. On microsoft Windows. Prepare to wait over 1 minute.

or when you are in the middle of a very large merge.

Re: Magit, the magical Git interface (2017)

#244
Magit doesn’t abstract git away so much as make it more accessible. For those that know Git, it’s an intuitive UI improving productivity and for those that don’t, an invaluable learning tool organised logically. The documentation is first-class and it’s a real pleasure to use. It’s a real gem. And although a cliché, it’s the reason I install emacs in the places I do.

Re: Magit, the magical Git interface (2017)

#245

Earlier quoted context omitted.

The second line you quoted tells you how.

When selecting only part of line, 's' will still stage the full line for me.

Indeed.

  cd $(mktemp -d)
  git init
  echo bar > file.txt
  git add file.txt
  git commit -m "init"
  echo foo_bar_baz > file.txt
  # select only "foo_" in magit-status and press "s"
  git diff --cached
will show

  diff --git a/file.txt b/file.txt
  index 5716ca5..2fd000c 100644
  --- a/file.txt
  +++ b/file.txt
  @@ -1 +1,2 @@
   bar
  +foo_bar_baz
rather than the desired

  diff --git a/file.txt b/file.txt
  index 5716ca5..2fd000c 100644
  --- a/file.txt
  +++ b/file.txt
  @@ -1 +1,2 @@
  -bar
  +foo_bar
I can't really imagine this feature working that well with just selection. Editing of the diff seems required.

I just updated magit, too. It seems to have been published 3 days ago.

Re: Magit, the magical Git interface (2017)

#246
post #229
post #167

Earlier quoted context omitted.

You can customize the menu (and I do) to add a Git menu sub panel (for lack of a better word) that has an up and down arrow for push and pull. In the lower right, there's the vcs "where you're at" that shows the current branch. From there you can see the status of your branch compared to others (if you need to fetch them), or you can update branches (even those you're not currently on) along with branch specific oper…

Oh wow I didn't know that search everything in Jetbrains products included the menus and not just the contents of the project. That's handy to know. I've been a fan of Ctrl-Shift-P in Sublime Text, so it's always good to see similar features in other software.

I've used it for the "where is that show whitespace menu setting? meh... shift shift whitespace. Change setting."

Also, glance under the "Help" menu - there's a productivity guide. That shows you a whole bunch of features (and how often they're used) and how to use them.

Re: Magit, the magical Git interface (2017)

#248
Past threads:

Magit 3.0 - https://news.ycombinator.com/item?id=27274670 - May 2021 (140 comments)

Magit – A Git Porcelain inside Emacs - https://news.ycombinator.com/item?id=24431216 - Sept 2020 (83 comments)

A walk through the Magit interface - https://news.ycombinator.com/item?id=21729597 - Dec 2019 (81 comments)

Forge – Work with Git forges from the comfort of Magit - https://news.ycombinator.com/item?id=19137353 - Feb 2019 (34 comments)

Magit 2.13 released - https://news.ycombinator.com/item?id=17220630 - June 2018 (49 comments)

Show HN: Magit, the magical Git interface - https://news.ycombinator.com/item?id=15358723 - Sept 2017 (5 comments)

Magit Kickstarter fully funded - https://news.ycombinator.com/item?id=15312288 - Sept 2017 (71 comments)

Magit (fantastic Git mode for emacs) is running a crowdfunding campaign - https://news.ycombinator.com/item?id=15263869 - Sept 2017 (4 comments)

Magit on Kickstarter - https://news.ycombinator.com/item?id=15154712 - Sept 2017 (1 comment)

It's Magit the Magical Git Client by Jonas Bernoulli – Kickstarter - https://news.ycombinator.com/item?id=15150476 - Sept 2017 (2 comments)

Emacs and Magit - https://news.ycombinator.com/item?id=14819256 - July 2017 (174 comments)

Magit maintainer taking a break - https://news.ycombinator.com/item?id=11077526 - Feb 2016 (1 comment)

Magit: a Git porcelain inside emacs - https://news.ycombinator.com/item?id=10643977 - Nov 2015 (14 comments)

What's new in Magit 2.x - https://news.ycombinator.com/item?id=9936095 - July 2015 (23 comments)

Using Emacs and Git with Magit 2.1 - https://news.ycombinator.com/item?id=9873237 - July 2015 (29 comments)

Magit a Git Porcelain for Emacs - https://news.ycombinator.com/item?id=9547948 - May 2015 (2 comments)

Meet Magit - Git Mode for Emacs - https://news.ycombinator.com/item?id=2543265 - May 2011 (4 comments)

Magit: Emacs mode for Git - https://news.ycombinator.com/item?id=361697 - Nov 2008 (2 comments)

Re: Magit, the magical Git interface (2017)

#249
post #98

I use git from the command line, so this looked like a tool i would use. I was able to install it with apt, but i could not find any information on how to run it. Manual says "C-x g" [1], which obviously does nothing in bash. And I have no idea how to use emacs. Is there any helpful user manual? Should i give up on magit? [1] https://magit.vc/manual/magit/Getting-Started.html

You can give Spacemacs a try if you want Vim bindings.

Re: Magit, the magical Git interface (2017)

#250
post #135

Earlier quoted context omitted.

> stash some of my changes, switch branch, cherry pick a commit, switch branch, do an interactive rebase reordering commits and dropping one, pop one of my stashes > working with code becomes a fluent experience, rather than fighting with your tools I also do this regularly, but on my terminal. I don't feel like I'm fighting the git tools. Is this a common experience? I enjoy using git GUIs as well, especially for vi…

I am the same. After the pandemic started and I had to witness over screen share how colleagues "use" (fight) git with all sorts of GUI tools, I had to realize that no GUI can be good enough while one doesn't understand git, or, even worse, it can be contraproductive, because people using these GUIs _think_ they understand, but they don't. I even ended up creating a (tailored) 2x90min git course... All that said, I h…

Magit is absolutely fantastic and it reduces friction, discoverability and joy. rebasing is easy. commiting is easy. staging is easy. discovering is easy. everything is easy. it's incredibly powerful and also incredibly easy to use. it's simply the best software i've seen written in a long time.

sounds like hyperbole but it's not.

edit: magit is like if you spent months crafting a bunch of aliases for the command line and then made a nice little menu of all of them and committed that to memory but also has it as a popup. and even then magit is an order of magnitude better... handily so.

Post reply on HN