git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: skimo@liacs.nl
To: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 1/4] export get_short_sha1
Date: Sun,  8 Jul 2007 18:23:24 +0200	[thread overview]
Message-ID: <11839118081240-git-send-email-skimo@liacs.nl> (raw)
In-Reply-To: <11839118073186-git-send-email-skimo@liacs.nl>

From: Sven Verdoolaege <skimo@kotnet.org>

Sometimes it is useful to check whether a given string
is exactly a short SHA1.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
---
 cache.h     |    1 +
 sha1_name.c |    3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cache.h b/cache.h
index e64071e..8fda8ee 100644
--- a/cache.h
+++ b/cache.h
@@ -391,6 +391,7 @@ static inline unsigned int hexval(unsigned char c)
 
 extern int get_sha1(const char *str, unsigned char *sha1);
 extern int get_sha1_with_mode(const char *str, unsigned char *sha1, unsigned *mode);
+extern int get_short_sha1(const char *name, int len, unsigned char *sha1, int quietly);
 extern int get_sha1_hex(const char *hex, unsigned char *sha1);
 extern char *sha1_to_hex(const unsigned char *sha1);	/* static buffer result! */
 extern int read_ref(const char *filename, unsigned char *sha1);
diff --git a/sha1_name.c b/sha1_name.c
index 858f08c..0bed79d 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -154,8 +154,7 @@ static int find_unique_short_object(int len, char *canonical,
 	return 0;
 }
 
-static int get_short_sha1(const char *name, int len, unsigned char *sha1,
-			  int quietly)
+int get_short_sha1(const char *name, int len, unsigned char *sha1, int quietly)
 {
 	int i, status;
 	char canonical[40];
-- 
1.5.3.rc0.68.geec71-dirty

  reply	other threads:[~2007-07-08 16:24 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-08 16:23 [PATCH 0/4] Add git-rewrite-commits skimo
2007-07-08 16:23 ` skimo [this message]
2007-07-08 16:23 ` [PATCH 2/4] export add_ref_decoration skimo
2007-07-08 16:23 ` [PATCH 3/4] revision: mark commits that didn't match a pattern for later use skimo
2007-07-08 16:23 ` [PATCH 4/4] Add git-rewrite-commits skimo
2007-07-08 16:37   ` Johannes Schindelin
2007-07-08 17:30     ` Sven Verdoolaege
2007-07-08 18:17       ` Johannes Schindelin
2007-07-08 19:11         ` Sven Verdoolaege
2007-07-08 18:04     ` Steven Grimm
2007-07-08 18:15       ` Sven Verdoolaege
2007-07-08 18:41       ` Johannes Schindelin
2007-07-08 21:10         ` Sven Verdoolaege
2007-07-09  9:01           ` Johannes Sixt
2007-07-09  9:48             ` Sven Verdoolaege
2007-07-09 11:57             ` Johannes Schindelin
2007-07-08 23:56   ` Johannes Schindelin
2007-07-09  9:47     ` Sven Verdoolaege
2007-07-09 12:57       ` Johannes Schindelin
2007-07-09 13:49         ` Sven Verdoolaege
2007-07-09 14:11           ` Johannes Schindelin
2007-07-09 14:42             ` Sven Verdoolaege
2007-07-09 14:59               ` Johannes Schindelin
2007-07-09 12:36     ` Jeff King
2007-07-09 13:16       ` Johannes Schindelin

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=11839118081240-git-send-email-skimo@liacs.nl \
    --to=skimo@liacs.nl \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).