[tor-bugs] #29588 [Core Tor/Tor]: Make a post-merge hook that logs a message when the git hooks are updated in master

Tor Bug Tracker & Wiki blackhole at torproject.org
Sun Mar 10 16:49:29 UTC 2019


#29588: Make a post-merge hook that logs a message when the git hooks are updated
in master
---------------------------------------+----------------------------------
 Reporter:  teor                       |          Owner:  rl1987
     Type:  enhancement                |         Status:  needs_review
 Priority:  Medium                     |      Milestone:  Tor: unspecified
Component:  Core Tor/Tor               |        Version:
 Severity:  Normal                     |     Resolution:
 Keywords:  git-scripts, 041-proposed  |  Actual Points:
Parent ID:                             |         Points:  1
 Reviewer:  nickm                      |        Sponsor:
---------------------------------------+----------------------------------
Changes (by rl1987):

 * status:  needs_revision => needs_review


Comment:

 Hello, sorry about that. I fixed the issues and opened a new pull request
 to clean up a git history and resolve a merge conflict:
 https://github.com/torproject/tor/pull/780

 It works now:

 {{{
 vagrant at stretch:~/tor$ cp scripts/git/post-merge.git-hook .git/hooks/post-
 merge
 vagrant at stretch:~/tor$ git rev-parse --abbrev-ref HEAD
 ticket29588_2
 vagrant at stretch:~/tor$ echo "###" >> .git/hooks/post-merge
 vagrant at stretch:~/tor$ git reset --hard HEAD~2
 HEAD is now at 5f253f6a4 Iterate over contents of scripts/git with
 check_for_script_update function
 vagrant at stretch:~/tor$ git pull
 Updating 5f253f6a4..0befdb8a3
 Fast-forward
  scripts/git/post-merge.git-hook | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 ATTENTION: post-merge hook has changed:
 ===============================
 --- /home/vagrant/tor/.git/hooks/post-merge     2019-03-10
 16:45:14.000000000 +0000
 +++ /home/vagrant/tor/scripts/git/post-merge.git-hook   2019-03-10
 16:45:36.000000000 +0000
 @@ -43,4 +43,3 @@
          check_for_script_update "$file"
  done

 -###
 ATTENTION: /home/vagrant/tor/scripts/git/post-merge.git-hook has changed:
 diff --git a/scripts/git/post-merge.git-hook b/scripts/git/post-merge.git-
 hook
 index ed0e16279..176b7c9bb 100755
 --- a/scripts/git/post-merge.git-hook
 +++ b/scripts/git/post-merge.git-hook
 @@ -20,7 +20,7 @@ check_for_diffs() {
                 then
                          echo "ATTENTION: $1 hook has changed:"
                          echo "==============================="
 -                        diff "$installed" "$latest"
 +                        diff -u "$installed" "$latest"
                 fi
          fi
  }
 @@ -31,7 +31,7 @@ check_for_script_update() {
          if ! git diff ORIG_HEAD HEAD --exit-code -- "$fullpath"
 >/dev/null
          then
                  echo "ATTENTION: $1 has changed:"
 -                git diff ORIG_HEAD HEAD -- "$fullpath"
 +                git --no-pager diff ORIG_HEAD HEAD -- "$fullpath"
          fi
  }
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/29588#comment:9>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list