unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 3329bf59e1d61bd84dd1b6585a16cccccd998db7 1143 bytes (raw)
name: build-aux/git-hooks/pre-push 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
 
#!/bin/sh

awk -v origin_name="$1" '
  @include ".git/hooks/commit-msg-files.awk"

  # If the local SHA is all zeroes, ignore it.
  $2 ~ /^0{40}$/ {
    next
  }

  $2 ~ /^[a-z0-9]{40}$/ {
    newref = $2

    # If the remote SHA is all zeroes, go backwards until we find a SHA on
    # an origin branch.
    if ($4 ~ /^0{40}$/) {
      back = 0
      while ((("git branch -r -l '\''" origin_name "/*'\'' --contains " \
               newref "~" back) | getline) == 0) {
        back++
      }

      ("git rev-parse " newref "~" back) | getline oldref
      if (!(oldref ~ /^[a-z0-9]{40}$/)) {
        # The SHA is misformatted?!
        exit 2
      }
    } else if ($4 ~ /^[a-z0-9]{40}$/)  {
      oldref = $4
    } else {
      # The remote SHA is misformatted?!
      exit 2
    }

    # Iterate over every SHA after oldref, up to (and including) newref.
    while ((("git rev-list --reverse " oldref ".." newref) | getline) > 0) {
      if (! check_commit_msg_files($0)) {
        status = 1
      }
    }
  }

  END {
    if (status != 0) {
      print "Push aborted; please see the file '\''CONTRIBUTE'\''"
    }
    exit status
  }
'

debug log:

solving 3329bf59e1d ...
found 3329bf59e1d in https://yhetil.org/emacs-devel/48d4dffa-cfa8-7949-3043-a1efa937902d@gmail.com/

applying [1/1] https://yhetil.org/emacs-devel/48d4dffa-cfa8-7949-3043-a1efa937902d@gmail.com/
diff --git a/build-aux/git-hooks/pre-push b/build-aux/git-hooks/pre-push
new file mode 100644
index 00000000000..3329bf59e1d

Checking patch build-aux/git-hooks/pre-push...
Applied patch build-aux/git-hooks/pre-push cleanly.

index at:
100644 3329bf59e1d61bd84dd1b6585a16cccccd998db7	build-aux/git-hooks/pre-push

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).