{"thread":{"id":"11616","subject":"[PATCH] Remove usage of git- (dash) commands from email hook","startedAt":"2008-01-14T04:51:01Z","lastAt":"2008-01-14T04:51:01Z","messageCount":1,"participants":["Dan McGee"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"65297","messageId":"1200286261-12209-1-git-send-email-dpmcgee@gmail.com","threadId":"11616","inReplyTo":null,"subject":"[PATCH] Remove usage of git- (dash) commands from email hook","fromName":"Dan McGee","fromEmail":"dpmcgee@gmail.com","sentAt":"2008-01-14T04:51:01Z","receivedAt":"2008-01-14T04:51:01Z","isPatch":true,"sender":{"key":"dpmcgee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/265817?v=4"},"body":"Switch all git command calls to use the git (space) command format, and\nremove the use of git-repo-config in place of git config.\n\nSigned-off-by: Dan McGee <dpmcgee@gmail.com>\n---\n contrib/hooks/post-receive-email |   34 +++++++++++++++++-----------------\n 1 files changed, 17 insertions(+), 17 deletions(-)\n\ndiff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email\nindex 7511ea0..77c88eb 100644\n--- a/contrib/hooks/post-receive-email\n+++ b/contrib/hooks/post-receive-email\n@@ -248,24 +248,24 @@ generate_update_branch_email()\n \t# In this case we want to issue an email containing only revisions\n \t# 3, 4, and N.  Given (almost) by\n \t#\n-\t#  git-rev-list N ^O --not --all\n+\t#  git rev-list N ^O --not --all\n \t#\n \t# The reason for the \"almost\", is that the \"--not --all\" will take\n \t# precedence over the \"N\", and effectively will translate to\n \t#\n-\t#  git-rev-list N ^O ^X ^N\n+\t#  git rev-list N ^O ^X ^N\n \t#\n-\t# So, we need to build up the list more carefully.  git-rev-parse\n-\t# will generate a list of revs that may be fed into git-rev-list.\n+\t# So, we need to build up the list more carefully.  git rev-parse\n+\t# will generate a list of revs that may be fed into git rev-list.\n \t# We can get it to make the \"--not --all\" part and then filter out\n \t# the \"^N\" with:\n \t#\n-\t#  git-rev-parse --not --all | grep -v N\n+\t#  git rev-parse --not --all | grep -v N\n \t#\n-\t# Then, using the --stdin switch to git-rev-list we have effectively\n+\t# Then, using the --stdin switch to git rev-list we have effectively\n \t# manufactured\n \t#\n-\t#  git-rev-list N ^O ^X\n+\t#  git rev-list N ^O ^X\n \t#\n \t# This leaves a problem when someone else updates the repository\n \t# while this script is running.  Their new value of the ref we're\n@@ -274,10 +274,10 @@ generate_update_branch_email()\n \t# all of our commits.  What we really want is to exclude the current\n \t# value of $refname from the --not list, rather than N itself.  So:\n \t#\n-\t#  git-rev-parse --not --all | grep -v $(git-rev-parse $refname)\n+\t#  git rev-parse --not --all | grep -v $(git rev-parse $refname)\n \t#\n \t# Get's us to something pretty safe (apart from the small time\n-\t# between refname being read, and git-rev-parse running - for that,\n+\t# between refname being read, and git rev-parse running - for that,\n \t# I give up)\n \t#\n \t#\n@@ -295,7 +295,7 @@ generate_update_branch_email()\n \t# As above, we need to take into account the presence of X; if\n \t# another branch is already in the repository and points at some of\n \t# the revisions that we are about to output - we don't want them.\n-\t# The solution is as before: git-rev-parse output filtered.\n+\t# The solution is as before: git rev-parse output filtered.\n \t#\n \t# Finally, tags: 1 --- 2 --- O --- T --- 3 --- 4 --- N\n \t#\n@@ -305,7 +305,7 @@ generate_update_branch_email()\n \t# for a branch update.  Therefore we still want to output revisions\n \t# that have been output on a tag email.\n \t#\n-\t# Luckily, git-rev-parse includes just the tool.  Instead of using\n+\t# Luckily, git rev-parse includes just the tool.  Instead of using\n \t# \"--all\" we use \"--branches\"; this has the added benefit that\n \t# \"remotes/\" will be ignored as well.\n \n@@ -454,7 +454,7 @@ generate_update_atag_email()\n #\n generate_atag_email()\n {\n-\t# Use git-for-each-ref to pull out the individual fields from the\n+\t# Use git for-each-ref to pull out the individual fields from the\n \t# tag\n \teval $(git for-each-ref --shell --format='\n \ttagobject=%(*objectname)\n@@ -572,7 +572,7 @@ generate_general_email()\n \telse\n \t\t# What can we do here?  The tag marks an object that is not\n \t\t# a commit, so there is no log for us to display.  It's\n-\t\t# probably not wise to output git-cat-file as it could be a\n+\t\t# probably not wise to output git cat-file as it could be a\n \t\t# binary blob.  We'll just say how big it is\n \t\techo \"$newrev is a $newrev_type, and is $(git cat-file -s $newrev) bytes long.\"\n \tfi\n@@ -622,10 +622,10 @@ then\n \tprojectdesc=\"UNNAMED PROJECT\"\n fi\n \n-recipients=$(git repo-config hooks.mailinglist)\n-announcerecipients=$(git repo-config hooks.announcelist)\n-envelopesender=$(git-repo-config hooks.envelopesender)\n-emailprefix=$(git-repo-config hooks.emailprefix || echo '[SCM] ')\n+recipients=$(git config hooks.mailinglist)\n+announcerecipients=$(git config hooks.announcelist)\n+envelopesender=$(git config hooks.envelopesender)\n+emailprefix=$(git config hooks.emailprefix || echo '[SCM] ')\n \n # --- Main loop\n # Allow dual mode: run from the command line just like the update hook, or\n-- \n1.5.4.rc3\n"}]}