salarkhan / git-pear

swap credentials after each commit
3 stars 0 forks source link

Adding teammates #6

Closed salarkhan closed 10 years ago

salarkhan commented 10 years ago

Here are the 2 options I see:

The latter will allow us to maintain the current architecture in pear, while the former will require some shenanigans around lines 26-32 in pear.

Something along the lines of running a regex against the argument to check if it's an email && firing pear add $command? Seems kinda dumb..

salarkhan commented 10 years ago

Flow for add should be:

Add to text file

..and that's it. I think the prehook should just call 2 scripts to get the author & committer values out of that .txt

supertopher commented 10 years ago

i actually kinda like the use case in your first comment. It would allow lets say me as a local to add you and you only. i.e.:

pear add sk@gmail.com

this would create a text file with your email and my email (pulled from global) whereas

pear sk@gmail.com

would set the text file to be just you

also :+1: on the pre-hook functionality

salarkhan commented 10 years ago

the first thing you said makes it seem like pear add sk@gmail.com would touch the txt file, append the email from git config --global, and then append sk@gmail.com

pear sk@gmail.com on the other hand, would just do the 1st & 3rd thing.

is my understanding correct?

supertopher commented 10 years ago

yeah. does that sounds like a worthwhile thing to do or should be keep it more simple?