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

[PATCH v4 06/11] contrib: related: parse committish like format-patch

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Apr 25, 2013, 19:59 UTC
Message-ID
<1366919983-27521-7-git-send-email-felipe.contreras@gmail.com>
In-Reply-To
<1366919983-27521-1-git-send-email-felipe.contreras@gmail.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 contrib/related/git-related | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff --git a/contrib/related/git-related b/contrib/related/git-related
index 0015b3c..2f38ee1 100755
--- a/contrib/related/git-related
+++ b/contrib/related/git-related
@@ -126,6 +126,20 @@ class Commits
 
   def from_rev_args(args)
     return if args.empty?
+
+    revs = []
+
+    File.popen(%w[git rev-parse --revs-only --default=HEAD --symbolic] + args).each do |rev|
+      revs << rev.chomp
+    end
+
+    case revs.size
+    when 1
+      committish = [ '%s..HEAD' % revs[0] ]
+    else
+      committish = revs
+    end
+
     source = nil
     File.popen(%w[git rev-list --reverse] + args) do |p|
       p.each do |e|
-- 
1.8.2.1
Previous: Felipe ContrerasNext: Felipe Contreras
Message 12 of 17 in “Add new git-related helper to contrib”
  1. 00/11 Add new git-related helper to contribFelipe Contreras, Apr 25, 2013
  2. 01/11 Add new git-related helper to contribFelipe Contreras, Apr 25, 2013
  3. Felipe ContrerasApr 26, 2013
  4. Junio C HamanoApr 26, 2013
  5. Felipe ContrerasApr 26, 2013
  6. Ramkumar RamachandraApr 27, 2013
  7. Felipe ContrerasMay 13, 2013
  8. 02/11 contrib: related: add option parsingFelipe Contreras, Apr 25, 2013
  9. 03/11 contrib: related: add support for multiple patchesFelipe Contreras, Apr 25, 2013
  10. 04/11 contrib: related: add option to show commitsFelipe Contreras, Apr 25, 2013
  11. 05/11 contrib: related: add option to parse from committishFelipe Contreras, Apr 25, 2013
  12. 06/11 contrib: related: parse committish like format-patchFelipe Contreras, Apr 25, 2013
  13. 07/11 contrib: related: fix parsing of rev-list argsFelipe Contreras, Apr 25, 2013
  14. 08/11 contrib: related: support multiple rolesFelipe Contreras, Apr 25, 2013
  15. 09/11 contrib: related: sort by participationFelipe Contreras, Apr 25, 2013
  16. 10/11 contrib: related: group persons with same emailFelipe Contreras, Apr 25, 2013
  17. 11/11 contrib: related: add support for mailmapFelipe Contreras, Apr 25, 2013

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.