Fork me on GitHub
#off-topic
<
2017-02-07
>
borkdude14:02:27

@roelof try magit in Emacs - even if you don’t use Emacs for anything else, it’s worth it

sveri14:02:42

Holy Moly...are you suggesting using emacs, the thingy thing that can even cook coffee, for using git? :D:D

sveri14:02:13

But honestly, why would someone go through all the pain of learning this: https://magit.vc/manual/magit.html#Modes-and-Buffers if most of the UIs available for git are pretty self explanatory if you know what push/pull/commit does.

vijaykiran14:02:49

why would someone go through all the pain of learning 100 different tools when the thingy thing called emacs can even do everythingy 😛

amdt14:02:50

Magit’s interface on Git is really flexible.

amdt14:02:39

If you’re already familiar with Emacs, performing complicated stages involving chunks and regions is so easy.

sveri14:02:40

That might be and I would not argue that, as I never used it myself, but, @borkdude was suggesting it for someone that does not use Emacs for anything else, hence, most probably someone that is not familiar with emacs 😉

dominicm14:02:40

@amdt fugitive.vim is pretty easy for moving regions over is simple. You just open the file in the index & current file, and diff them.

amdt14:02:10

@sveri I see! I wouldn’t recommend it to a non-Emacs user either.

dominicm14:02:27

Generally speaking, putting chunks into the index is a simple concept that could be wrapped around any tool with diffing built in.

amdt14:02:00

I never enjoyed using git add --patch, glad to hear Fugitive makes that easier as well.

pesterhazy14:02:23

personally I think git add --patch is usually enough

pesterhazy14:02:46

you can remove (js/console "got here") statements in edit mode

dominicm14:02:58

mercurial goes the other way, and doens't have a staging area, it lets you remove changes from a commit though I think

borkdude14:02:59

It’s a shame my Emacs propaganda is so easily unmasked.

dominicm14:02:02

Quite interested in learning hg

pesterhazy14:02:24

I really like Emacs, but with git you want the simplest possible interface

dominicm14:02:25

But then http://gitless.com/ makes git seem more like hg

pesterhazy14:02:37

where you actually understand everything

borkdude14:02:37

But honestly, I’ve used magit on projects where I didn’t use emacs for programming. You only need to know a few commands to be productive in it. I rest my case 🙂.

dominicm14:02:52

I'm kinda of the opinion that you can't abstract away tools very much. All abstractions become leaky under scrutiny. If you don't understand git cli, you probably won't understand the tools that build upon it, unless they have a leakless abstraction & docs explaining them all in the context of that app.

amdt14:02:52

@pesterhazy Is Git’s add --patch as simple as placing the cursor over the offending line and typing C-SPC s? 😉

borkdude14:02:57

I also like just git add -p. For rebasing I usually use the cli, wouldn’t even know how to do it in magit.

pesterhazy14:02:13

I'll go with yes

pesterhazy14:02:56

:robot_face:

borkdude14:02:10

Didn’t Github have a good git gui that works cross platform? It’s been ages that I’ve used it.

pesterhazy14:02:43

oh and I also use tig to stage stuff

pesterhazy14:02:06

check it out, you can also stage line by line (not chunk by chunk, as with git add -p)

arttuka14:02:52

you can also stage chunks, but unfortunately it doesn’t show you what’s included in a chunk and doesn’t let you split chunks

fellshard16:02:58

I'd argue that the git graph isn't very easily represented through text, and is actually more informative through a GUI most of the time, provided it gives an accurate view of the tree and doesn't try to hide information (again, see SourceTree for an example of poor information hiding)

fellshard16:02:26

Git is far more about understanding the core abstraction - the graph - and the standard toolset that has been created to work with that graph.

fellshard16:02:39

(Hmm! Sounds familiar. 😉 )

dotemacs17:02:36

@pesterhazy about “but with git you want the simplest possible interface” what @borkdude said, magit gives you just that. But then again, as an emacs user I could be slightly biased, but please understand that this advice is given with a lot of love 🙂

sveri17:02:01

What I want with git is a very simple abstraction over the standard use cases which I get with the command line (git clone / push / commit / add / checkout). Thats basically 90% of my daily workflow which I can access in my always open terminal for exactly that purpose. Other than that we use bitbucket and I use the UI for pull requests and code review comments. And very seldom I need the log for which I find tortoise git very good as it gives me good filter capabilities over the whole history.

sveri17:02:52

Like for instance I did some changes to my current work, someone else comes in with an urgent request I would commit my changes, checkout a different branch and do some stuff. git commit -a -m "some weirdo commit message" git checkout feature/WhatsGoingOnHere git pull So I want to do that with magit and look in the docs. I find this: Initiating a Commit c (magit-commit-popup) Uhm, what is that? Most probably a command I have to invoke. Fine, should be easy. This opens two buffers, one with the commit message and one with the changes. Nice, I can see the changes, but what if I just want to commit straight away? I cannot find that command, so thats a first bumper for me. Next I can checkout with magit-checkout which seems to open a popup where I can select a branch, I think. Thats fine too, but I know the name of the branch already. Then magit-pull seems to just pull the changes straight away. All in all I have to learn another DSL for working with git which is not very intuitive. And then, to become productive I have to learn shortcuts for that new DSL. Seems like a lot of burden. Also, with gui tools the standard stuff is reachable with one or two clicks which is way easier for beginners I would argue. I am not sure, I dont think I would use it in my daily work. I dont use egit in eclipse either or source tree. Only when I need the visualization and then a "real" GUI seems better suited.

fellshard17:02:56

For your common use cases, CLI tools are fine. I find it's harder to intuitively see when, say, a rebase is appropriate, or how best to clean up a messy branch when using the CLI, primarily because it's designed to give you handles to SHAs, not to show you a holistic view of commits and their relationships. Part of that, though, could be me not knowing how to slice and dice data efficiently using those CLI tools.

fiddlerwoaroof18:02:48

git log --graph --format=oneline --decorate --all is useful for seeing the relation between commits

fellshard18:02:23

Do you find that text-based graph easy to parse, though?

fiddlerwoaroof18:02:26

I generally do all my git work with the CLI tools.

qqq19:02:47

anyone here have advice on doing freelancing/consulting work when your startup isn't working out?

fellshard23:02:44

That sounds like a recipe for burnout - extreme edition