Skip to content

Commit

Permalink
Add the repository-specific git config include (git >= 1.7.10)
Browse files Browse the repository at this point in the history
!!! NOTE - potential security RISK !!!

 You *MUST*
  - check the file is legit:
     git diff 7eb1f0e165a4 maint/git_config_dbic.inc

  - copy the file to your .git directory:
     cp maint/git_config_dbic.inc .git/

  - and include it:
     git config --add include.path git_config_dbic.inc

 **NEVER** include the file directly from the repository itself, e.g.

 [include]
   path = ../maint/git_config_dbic.inc

!!! NOTE - potential security RISK !!!

Adds extra maint-specific repositories, and defines two gitk shortcuts:

 `git vis` - showing all current heads/stashes of interest in progress
 `git prvis` - showing all unattended to github PRs
  • Loading branch information
ribasushi committed Jan 20, 2016
1 parent 7a96e0d commit 1f99022
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions maint/git_config_dbic.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[remote "ghpr"]
url = https://github.com/dbsrgits/DBIx-Class
pushurl = DISALLOWED
fetch = +refs/pull/*/head:refs/remotes/ghpr/*

[remote "historic"]
url = git://git.shadowcat.co.uk/dbsrgits/DBIx-Class-Historic.git
pushurl = ssh://dbsrgits@git.shadowcat.co.uk/DBIx-Class-Historic.git
fetch = +refs/heads/*:refs/remotes/historic/*

[remote "debian"]
url = git://anonscm.debian.org/pkg-perl/packages/libdbix-class-perl.git
pushurl = DISALLOWED
fetch = +refs/heads/master:refs/remotes/debian/master
tagopt = --no-tags

[alias]
# Lines after gitk in order:
#
# --exclude all refs matching the for loop
# all known refs (branches/tags) excepth what we excluded
# add all individual stashes
# add all github PR heads without a matching historic/ghpr/* entry
#
# the /bin/true at the end is there to eat away any args to 'vis'
# ( otherwise they will be treated as commands to execute after the & )
vis = "!gitk \
$( for r in historic/ghpr ghpr debian ; do echo "--exclude=refs/remotes/$r/*" ; done ) \
--all \
$(git stash list | cut -f 1 -d ':') \
$(/bin/bash -c \"/usr/bin/comm -23 \
<(git for-each-ref --sort=objectname --format='%(objectname:short)' refs/remotes/ghpr/ ) \
<(git for-each-ref --sort=objectname --format='%(objectname:short)' refs/remotes/historic/ghpr/ refs/remotes/origin/ ) \
\") \
\"$@\" & /bin/true"


# same but only for GitHub PRs
prvis = "!gitk \
$(/bin/bash -c \"/usr/bin/comm -23 \
<(git for-each-ref --sort=objectname --format='%(objectname:short)' refs/remotes/ghpr/ ) \
<(git for-each-ref --sort=objectname --format='%(objectname:short)' refs/remotes/historic/ghpr/ refs/remotes/origin/ ) \
\") \
\"$@\" & /bin/true"

0 comments on commit 1f99022

Please sign in to comment.