@matheusbsbs / matheus-bagliano / commits / 22fa97d4e0
Fork 0

Remove usage of git- (dash) commands from email hook

Switch all git command calls to use the git (space) command format, and remove the use of git-repo-config in place of git config. Signed-off-by: Dan McGee <dpmcgee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Dan McGee committed Jan 13, 2008 at 22:51 UTC 22fa97d4e011de82b44fdc83c27e919a996ce1be
1 file changed +17 -17
contrib/hooks/post-receive-email
+17 -17
@@ -248,24 +248,24 @@ generate_update_branch_email()
248 # In this case we want to issue an email containing only revisions
249 # 3, 4, and N. Given (almost) by
250 #
251 - # git-rev-list N ^O --not --all
251 + # git rev-list N ^O --not --all
252 #
253 # The reason for the "almost", is that the "--not --all" will take
254 # precedence over the "N", and effectively will translate to
255 #
256 - # git-rev-list N ^O ^X ^N
256 + # git rev-list N ^O ^X ^N
257 #
258 - # So, we need to build up the list more carefully. git-rev-parse
259 - # will generate a list of revs that may be fed into git-rev-list.
258 + # So, we need to build up the list more carefully. git rev-parse
259 + # will generate a list of revs that may be fed into git rev-list.
260 # We can get it to make the "--not --all" part and then filter out
261 # the "^N" with:
262 #
263 - # git-rev-parse --not --all | grep -v N
263 + # git rev-parse --not --all | grep -v N
264 #
265 - # Then, using the --stdin switch to git-rev-list we have effectively
265 + # Then, using the --stdin switch to git rev-list we have effectively
266 # manufactured
267 #
268 - # git-rev-list N ^O ^X
268 + # git rev-list N ^O ^X
269 #
270 # This leaves a problem when someone else updates the repository
271 # while this script is running. Their new value of the ref we're
@@ -274,10 +274,10 @@ generate_update_branch_email()
274 # all of our commits. What we really want is to exclude the current
275 # value of $refname from the --not list, rather than N itself. So:
276 #
277 - # git-rev-parse --not --all | grep -v $(git-rev-parse $refname)
277 + # git rev-parse --not --all | grep -v $(git rev-parse $refname)
278 #
279 # Get's us to something pretty safe (apart from the small time
280 - # between refname being read, and git-rev-parse running - for that,
280 + # between refname being read, and git rev-parse running - for that,
281 # I give up)
282 #
283 #
@@ -295,7 +295,7 @@ generate_update_branch_email()
295 # As above, we need to take into account the presence of X; if
296 # another branch is already in the repository and points at some of
297 # the revisions that we are about to output - we don't want them.
298 - # The solution is as before: git-rev-parse output filtered.
298 + # The solution is as before: git rev-parse output filtered.
299 #
300 # Finally, tags: 1 --- 2 --- O --- T --- 3 --- 4 --- N
301 #
@@ -305,7 +305,7 @@ generate_update_branch_email()
305 # for a branch update. Therefore we still want to output revisions
306 # that have been output on a tag email.
307 #
308 - # Luckily, git-rev-parse includes just the tool. Instead of using
308 + # Luckily, git rev-parse includes just the tool. Instead of using
309 # "--all" we use "--branches"; this has the added benefit that
310 # "remotes/" will be ignored as well.
311
@@ -454,7 +454,7 @@ generate_update_atag_email()
454 #
455 generate_atag_email()
456 {
457 - # Use git-for-each-ref to pull out the individual fields from the
457 + # Use git for-each-ref to pull out the individual fields from the
458 # tag
459 eval $(git for-each-ref --shell --format='
460 tagobject=%(*objectname)
@@ -572,7 +572,7 @@ generate_general_email()
572 else
573 # What can we do here? The tag marks an object that is not
574 # a commit, so there is no log for us to display. It's
575 - # probably not wise to output git-cat-file as it could be a
575 + # probably not wise to output git cat-file as it could be a
576 # binary blob. We'll just say how big it is
577 echo "$newrev is a $newrev_type, and is $(git cat-file -s $newrev) bytes long."
578 fi
@@ -622,10 +622,10 @@ then
622 projectdesc="UNNAMED PROJECT"
623 fi
624
625 -recipients=$(git repo-config hooks.mailinglist)
626 -announcerecipients=$(git repo-config hooks.announcelist)
627 -envelopesender=$(git-repo-config hooks.envelopesender)
628 -emailprefix=$(git-repo-config hooks.emailprefix || echo '[SCM] ')
625 +recipients=$(git config hooks.mailinglist)
626 +announcerecipients=$(git config hooks.announcelist)
627 +envelopesender=$(git config hooks.envelopesender)
628 +emailprefix=$(git config hooks.emailprefix || echo '[SCM] ')
629
630 # --- Main loop
631 # Allow dual mode: run from the command line just like the update hook, or