From: Adam Brewster <adambrewster@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, mdl123@verizon.net,
Johannes.Schindelin@gmx.de, jnareb@gmail.com,
adambrewster@gmail.com, Adam Brewster <asb@bu.edu>
Subject: [PATCH] Move read_revisions_from_stdin from builtin-rev-list.c to revision.c
Date: Sat, 5 Jul 2008 16:40:32 -0400 [thread overview]
Message-ID: <1215290434-27694-2-git-send-email-adambrewster@gmail.com> (raw)
In-Reply-To: <1215290434-27694-1-git-send-email-adambrewster@gmail.com>
Some other commands might like to support the --stdin option like
git-rev-list. Since they don't want to depend on builtin-rev-list, the
function has to be somewhere else.
Signed-off-by: Adam Brewster <asb@bu.edu>
---
builtin-rev-list.c | 17 -----------------
revision.c | 17 +++++++++++++++++
2 files changed, 17 insertions(+), 17 deletions(-)
mode change 100644 => 100755 builtin-rev-list.c
mode change 100644 => 100755 revision.c
diff --git a/builtin-rev-list.c b/builtin-rev-list.c
old mode 100644
new mode 100755
index 11a7eae..b4a2c44
--- a/builtin-rev-list.c
+++ b/builtin-rev-list.c
@@ -575,23 +575,6 @@ static struct commit_list *find_bisection(struct commit_list *list,
return best;
}
-static void read_revisions_from_stdin(struct rev_info *revs)
-{
- char line[1000];
-
- while (fgets(line, sizeof(line), stdin) != NULL) {
- int len = strlen(line);
- if (len && line[len - 1] == '\n')
- line[--len] = 0;
- if (!len)
- break;
- if (line[0] == '-')
- die("options not supported in --stdin mode");
- if (handle_revision_arg(line, revs, 0, 1))
- die("bad revision '%s'", line);
- }
-}
-
int cmd_rev_list(int argc, const char **argv, const char *prefix)
{
struct commit_list *list;
diff --git a/revision.c b/revision.c
old mode 100644
new mode 100755
index 5a1a948..0191160
--- a/revision.c
+++ b/revision.c
@@ -911,6 +911,23 @@ int handle_revision_arg(const char *arg, struct rev_info *revs,
return 0;
}
+void read_revisions_from_stdin(struct rev_info *revs)
+{
+ char line[1000];
+
+ while (fgets(line, sizeof(line), stdin) != NULL) {
+ int len = strlen(line);
+ if (len && line[len - 1] == '\n')
+ line[--len] = '\0';
+ if (!len)
+ break;
+ if (line[0] == '-')
+ die("options not supported in --stdin mode");
+ if (handle_revision_arg(line, revs, 0, 1))
+ die("bad revision '%s'", line);
+ }
+}
+
static void add_grep(struct rev_info *revs, const char *ptn, enum grep_pat_token what)
{
if (!revs->grep_filter) {
--
1.5.5.1.211.g65ea3.dirty
next prev parent reply other threads:[~2008-07-05 20:41 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-05 16:30 [PATCH/v3] bundle.c: added --stdin option to git-bundle Adam Brewster
2008-07-05 16:54 ` Jakub Narebski
2008-07-05 18:15 ` Junio C Hamano
2008-07-05 20:40 ` [PATCH v4 0/3] Adam Brewster
2008-07-05 20:40 ` Adam Brewster [this message]
2008-07-05 20:40 ` [PATCH] git-bundle: add --stdin Adam Brewster
2008-07-05 20:40 ` [PATCH] Add git-basis.perl to contrib directory Adam Brewster
2008-07-05 20:48 ` [PATCH] Move read_revisions_from_stdin from builtin-rev-list.c to revision.c Miklos Vajna
2008-07-05 21:26 ` [PATCH v5] Adam Brewster
2008-07-05 21:26 ` [PATCH] Move read_revisions_from_stdin from builtin-rev-list.c to revision.c Adam Brewster
2008-07-05 21:26 ` [PATCH] git-bundle: add --stdin Adam Brewster
2008-07-06 0:57 ` Teach git-bundle to read revision arguments from stdin like git-rev-list Junio C Hamano
2008-07-06 14:28 ` Adam Brewster
2008-07-06 14:28 ` [PATCH] git-rev-list: tolerate multiple --stdin options Adam Brewster
2008-07-06 14:28 ` [PATCH] Teach git-bundle to read revision arguments from stdin like Adam Brewster
2008-07-06 1:50 ` [PATCH v5] Junio C Hamano
2008-07-06 2:49 ` Adam Brewster
2008-07-06 0:57 ` [PATCH] Move read_revisions_from_stdin from builtin-rev-list.c to revision.c Junio C Hamano
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=1215290434-27694-2-git-send-email-adambrewster@gmail.com \
--to=adambrewster@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=asb@bu.edu \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jnareb@gmail.com \
--cc=mdl123@verizon.net \
/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).