salarkhan / git-pear

swap credentials after each commit
3 stars 0 forks source link

Ensure this works with just one email address #18

Closed supertopher closed 10 years ago

supertopher commented 10 years ago

seems like a likely use case on our workstations

salarkhan commented 10 years ago

if pear receives only 1 arg, >> it into team.txt twice?

that way get/set committer/author dont have to change functionality?

salarkhan commented 10 years ago

was going along this route:

# If only 1 member added, duplicate their info
if cat $team_text_location | wc -l == 1; then

and then I saw this:

# If multiple args given run this script once for each arg
test $2 && {
  for arg in $@
    do $0 $arg
  done
  exit
}

so...this might be a little more complicated than I thought.

maybe have another executable like pear solo email@address? or pear loljk email@address

salarkhan commented 10 years ago

Durr I guess I could just check how many args got passed into add and use that. (instead of checking team.txt) This actually might not be that complicated at all

supertopher commented 10 years ago

i think it would be ideal if we move this line to the check for more than one argument in add

[[ -f $git_dir/hooks/post-commit ]] || pear create-hook-file

if we start storing this data in local git config i think we can do this really really cleanly. honestly this is just the start of that thought. But if we store line 1 as config --local user.name and then have a store for the rest of the people it would always work... i think fuck I'm tired. I need to get this plan more focused... until it is your way is better

salarkhan commented 10 years ago

let's punt this till #42 is done

salarkhan commented 10 years ago

@supertopher I kinda wanna start on this one, but I have a feeling you might have some beef with the code in #45

I'll pick this up when #45 is merged

salarkhan commented 10 years ago

@supertopher, thought of some complications:

Thinking that pear add should simply clear out the team.emails config key before doing anything else. Thoughts? Although, this is dependent on #45 not changing, so look at that one first!

salarkhan commented 10 years ago

closed via #50