From: "Kristian Høgsberg" <krh@redhat.com>
To: git@vger.kernel.org
Cc: "Kristian Høgsberg" <krh@redhat.com>
Subject: [PATCH 8/9] Export rerere() and launch_editor().
Date: Wed, 5 Sep 2007 20:23:37 -0400 [thread overview]
Message-ID: <11890382264046-git-send-email-krh@redhat.com> (raw)
In-Reply-To: <11890382262161-git-send-email-krh@redhat.com>
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
---
builtin-rerere.c | 16 ++++++++++++++++
builtin-tag.c | 3 +--
commit.h | 1 +
strbuf.h | 1 +
4 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/builtin-rerere.c b/builtin-rerere.c
index 29d057c..eb22a28 100644
--- a/builtin-rerere.c
+++ b/builtin-rerere.c
@@ -415,6 +415,22 @@ static int is_rerere_enabled(void)
return 1;
}
+/* Export for builtin-commit. */
+int rerere(void)
+{
+ struct path_list merge_rr = { NULL, 0, 0, 1 };
+ int fd;
+
+ git_config(git_rerere_config);
+ if (!is_rerere_enabled())
+ return 0;
+
+ merge_rr_path = xstrdup(git_path("rr-cache/MERGE_RR"));
+ fd = hold_lock_file_for_update(&write_lock, merge_rr_path, 1);
+ read_rr(&merge_rr);
+ return do_plain_rerere(&merge_rr, fd);
+}
+
int cmd_rerere(int argc, const char **argv, const char *prefix)
{
struct path_list merge_rr = { NULL, 0, 0, 1 };
diff --git a/builtin-tag.c b/builtin-tag.c
index 8724d49..3b181f5 100644
--- a/builtin-tag.c
+++ b/builtin-tag.c
@@ -18,12 +18,11 @@ static const char builtin_tag_usage[] =
static char signingkey[1000];
-static void launch_editor(const char *path, struct strbuf *sb)
+void launch_editor(const char *path, struct strbuf *sb)
{
const char *editor, *terminal;
struct child_process child;
const char *args[3];
- int fd;
editor = getenv("GIT_EDITOR");
if (!editor && editor_program)
diff --git a/commit.h b/commit.h
index 64e1d4b..39934cc 100644
--- a/commit.h
+++ b/commit.h
@@ -130,5 +130,6 @@ create_commit(const unsigned char *tree_sha1,
const char *message, int length);
extern int interactive_add(void);
+extern int rerere(void);
#endif /* COMMIT_H */
diff --git a/strbuf.h b/strbuf.h
index e852070..b009b4b 100644
--- a/strbuf.h
+++ b/strbuf.h
@@ -16,5 +16,6 @@ extern void strbuf_printf(struct strbuf *sb, const char *fmt, ...);
extern int strbuf_read_fd(struct strbuf *sb, int fd);
extern int strbuf_read_path(struct strbuf *sb, const char *path);
extern size_t stripspace(struct strbuf *sb, int skip_comments);
+extern void launch_editor(const char *path, struct strbuf *sb);
#endif /* STRBUF_H */
--
1.5.2.GIT
next prev parent reply other threads:[~2007-09-06 0:36 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-06 0:23 [PATCH 1/9] Enable wt-status output to a given FILE pointer Kristian Høgsberg
2007-09-06 0:23 ` [PATCH 2/9] Enable wt-status to run against non-standard index file Kristian Høgsberg
2007-09-06 0:23 ` [PATCH 3/9] Add strbuf_printf() to do formatted printing to a strbuf Kristian Høgsberg
2007-09-06 0:23 ` [PATCH 4/9] Introduce entry point for launching add--interactive Kristian Høgsberg
2007-09-06 0:23 ` [PATCH 5/9] Introduce strbuf_read_fd() Kristian Høgsberg
2007-09-06 0:23 ` [PATCH 6/9] Rewrite launch_editor, create_tag and stripspace to use strbufs Kristian Høgsberg
2007-09-06 0:23 ` [PATCH 7/9] Add strbuf_read_path() Kristian Høgsberg
2007-09-06 0:23 ` Kristian Høgsberg [this message]
2007-09-06 0:23 ` [PATCH 9/9] Implement git commit as a builtin command Kristian Høgsberg
2007-09-06 16:59 ` Johannes Schindelin
2007-09-17 22:58 ` Kristian Høgsberg
2007-09-17 23:16 ` Johannes Schindelin
2007-09-17 23:56 ` Jeff King
2007-09-18 0:11 ` Kristian Høgsberg
2007-09-06 16:40 ` [PATCH 7/9] Add strbuf_read_path() Johannes Schindelin
2007-09-06 16:38 ` [PATCH 6/9] Rewrite launch_editor, create_tag and stripspace to use strbufs Johannes Schindelin
2007-09-17 22:59 ` Kristian Høgsberg
2007-09-06 16:31 ` [PATCH 4/9] Introduce entry point for launching add--interactive Johannes Schindelin
2007-09-17 23:13 ` Kristian Høgsberg
2007-09-17 23:27 ` Johannes Schindelin
2007-09-06 8:55 ` [PATCH 3/9] Add strbuf_printf() to do formatted printing to a strbuf Junio C Hamano
2007-09-06 9:43 ` Pierre Habouzit
2007-09-06 9:50 ` Pierre Habouzit
2007-09-06 16:27 ` [PATCH 1/9] Enable wt-status output to a given FILE pointer Johannes Schindelin
2007-09-17 23:30 ` Kristian Høgsberg
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11890382264046-git-send-email-krh@redhat.com \
--to=krh@redhat.com \
--cc=git@vger.kernel.org \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.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).