Skip to content

Commit

Permalink
git script tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
dflems committed Jan 18, 2016
1 parent 85f1d0a commit b804053
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion git/bin/git-delete-local-merged
Expand Up @@ -2,4 +2,4 @@
#
# Delete all local branches that have been merged into HEAD.

git branch -d `git branch --merged | grep -v '^*' | grep -v 'master' | tr -d '\n'`
git branch --merged | grep -v '^*' | grep -v 'master' | tr -d '\n' | xargs -L1 git branch -d
5 changes: 5 additions & 0 deletions git/bin/git-subclean
@@ -0,0 +1,5 @@
#!/bin/bash

git submodule foreach --recursive 'git reset --hard HEAD && git clean -dffx'
git submodule sync
git submodule update --init --recursive
2 changes: 1 addition & 1 deletion git/bin/git-webpr
Expand Up @@ -26,7 +26,7 @@ remote_name, branch_name = tracking.split('/', 2)
# get endpoints for remotes
remote_endpoints = Hash[`git remote -v`.strip.split("\n").map{|x| x.split(/\s+/)}.select{|x| x[2] == '(fetch)'}.map{|x| x[0..1]}]
remote = parse_url(remote_endpoints[remote_name]) || abort("No remote named \"#{remote_name}\"")
upstream = parse_url(remote_endpoints["upstream"]) || abort('No remote named "upstream"')
upstream = parse_url(remote_endpoints["upstream"]) || parse_url(remote_endpoints["origin"]) || abort('No remote named "upstream" or "origin"')

# both origins need to be on same host to create a PR
abort "Remotes must be on same host" unless remote[:host] == upstream[:host]
Expand Down

0 comments on commit b804053

Please sign in to comment.