git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Adding list of p4 jobs to git commit message

From
Jan Durovec <jan.durovec@gmail.com>
Date
Apr 15, 2016, 19:51 UTC
Message-ID
<010201541b7a24b8-83b0f526-2f01-40e3-afc8-d81549af70d4-000000@eu-west-1.amazonses.com>
---
 git-p4.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff --git a/git-p4.py b/git-p4.py
index 527d44b..a81795f 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -2320,6 +2320,15 @@ def extractFilesFromCommit(self, commit):
             fnum = fnum + 1
         return files
 
+    def extractJobsFromCommit(self, commit):
+        jobs = []
+        jnum = 0
+        while commit.has_key("job%s" % jnum):
+            job = commit["job%s" % jnum]
+            jobs.append(job)
+            jnum = jnum + 1
+        return jobs
+
     def stripRepoPath(self, path, prefixes):
         """When streaming files, this is called to map a p4 depot path
            to where it should go in git.  The prefixes are either
@@ -2665,6 +2674,7 @@ def hasBranchPrefix(self, path):
     def commit(self, details, files, branch, parent = ""):
         epoch = details["time"]
         author = details["user"]
+        jobs = self.extractJobsFromCommit(details)
 
         if self.verbose:
             print('commit into {0}'.format(branch))
@@ -2696,6 +2706,8 @@ def commit(self, details, files, branch, parent = ""):
                              (','.join(self.branchPrefixes), details["change"]))
         if len(details['options']) > 0:
             self.gitStream.write(": options = %s" % details['options'])
+        if len(jobs) > 0:
+            self.gitStream.write(": jobs = %s" % (','.join(jobs)))
         self.gitStream.write("]\nEOT\n\n")
 
         if len(parent) > 0:

--
https://github.com/git/git/pull/225
Next: Junio C Hamano
Message 1 of 5 in “Adding list of p4 jobs to git commit message”
  1. Adding list of p4 jobs to git commit messageJan Durovec, Apr 15, 2016
  2. Junio C HamanoApr 15, 2016
  3. Luke DiamandApr 15, 2016
  4. Jan DurovecApr 16, 2016
  5. Lars SchneiderApr 16, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.