List for cgit developers and users
 help / color / mirror / Atom feed
From: mailings at hupie.com (Ferry Huberts)
Subject: [RESEND] [PATCH v3 1/1] commit-links.sh: improve regular expressions
Date: Mon, 18 Jul 2011 12:45:20 +0200	[thread overview]
Message-ID: <1310985920-13808-1-git-send-email-mailings@hupie.com> (raw)
In-Reply-To: <1308775583-22566-1-git-send-email-mailings@hupie.com>

From: Ferry Huberts <ferry.huberts at pelagic.nl>

The default length for sha1 abbreviations in git is 7.

A '#num' at the beginning of the commit message is now
recognised, a ':#num' as well, etc.: a '#num' anywhere
is now converted to a link.

Signed-off-by: Ferry Huberts <ferry.huberts at pelagic.nl>
---
 filters/commit-links.sh |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/filters/commit-links.sh b/filters/commit-links.sh
index d2cd2b3..5881952 100755
--- a/filters/commit-links.sh
+++ b/filters/commit-links.sh
@@ -15,11 +15,14 @@
 # CGIT_REPO_CLONE_URL  ( = repo.clone-url setting )
 #
 
+regex=''
+
 # This expression generates links to commits referenced by their SHA1.
 regex=$regex'
-s|\b([0-9a-fA-F]{8,40})\b|<a href="./?id=\1">\1</a>|g'
+s|\b([0-9a-fA-F]{7,40})\b|<a href="./?id=\1">\1</a>|g'
+
 # This expression generates links to a fictional bugtracker.
 regex=$regex'
-s| #([0-9]+)\b|<a href="http://bugs.example.com/?bug=\1">#\1</a>|g'
+s|#([0-9]+)\b|<a href="http://bugs.example.com/?bug=\1">#\1</a>|g'
 
 sed -re "$regex"
-- 
1.7.5.4





  parent reply	other threads:[~2011-07-18 10:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-22 20:46 [RESEND] [PATCH v2 " mailings
2011-06-22 21:09 ` hjemli
     [not found]   ` <4E025ADA.7030603@hupie.com>
2011-06-22 21:26     ` hjemli
2011-06-23  0:43 ` [PATCH v3 " mailings
2011-07-18 10:45 ` mailings [this message]
2011-07-19  7:14   ` [RESEND] " larsh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1310985920-13808-1-git-send-email-mailings@hupie.com \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).