News for hackers. Stuff that matters.
Re:Git Legit by dkhenry on Friday January 18, 2013 @08:36PM (#5082225)
I am less interested in legit and more interested in how they extended git to make it so all their new commands worked.
Re:Git Legit by aaronharnly on Friday January 18, 2013 @08:47PM (#5082264)
This can be done in two ways:

1. Git aliases.

You can add configuration to git so that git subcommands invoke arbitrary commands:

https://git.wiki.kernel.org/index.php/Aliases

This is what legit does, here:

https://github.com/kennethreitz/legit/blob/develop/legit/cli...

2. Any executable in your path named 'git-foo' can be invoked by 'git foo'.

Neat, huh? It's a useful way to create your own workflow scripts without having to touch your git install.

Re:Git Legit by haldean on Friday January 18, 2013 @08:45PM (#5082256)
You don't need to extend git; the git command "git $FOO" just runs the command git-$FOO; git-commit, git-add, etc. are the binaries that do a lot of the work. In this case, I imagine they install binaries like git-sync, git-graft, etc. when you run "legit install".
Re:Git Legit by habosa on Friday January 18, 2013 @08:47PM (#5082265)
Is this a vulnerability in some way? Like could I replace someone's git-add binary to expose private source code? It scares me that someone can change my git behavior so easily.
Re:Git Legit by skymt on Friday January 18, 2013 @09:01PM (#5082296)
If someone can replace your `git-add` binary or put their own in a directory earlier in your $PATH, they can do the same with `git`, `ls` or any other program.
Re:Git Legit by zck on Friday January 18, 2013 @09:05PM (#5082307)
If someone's running an executable you give them without knowing what it actually is, their security is already lost. So yeah, that's a problem, but nothing specific to Legit or git.
Re:Git Legit by hcarvalhoalves on Friday January 18, 2013 @09:03PM (#5082300)
How is that any different than replacing any other binary in your filesystem?
Re:Git Legit by eyko on Saturday January 19, 2013 @04:49AM (#5083039)