git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marco Costalba" <mcostalba@gmail.com>
To: "Git Mailing List" <git@vger.kernel.org>
Cc: "Linus Torvalds" <torvalds@linux-foundation.org>
Subject: [PATCH qgit] Update to latest --early-output git log patch
Date: Sun, 4 Nov 2007 21:50:35 +0100	[thread overview]
Message-ID: <e5bfff550711041250p1c48910fqa631cd7fd3c505f8@mail.gmail.com> (raw)

Fix broken implementation after Linus updated his
early output patch to version with improve output format.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
---
 src/git.h           |    2 +-
 src/git_startup.cpp |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/git.h b/src/git.h
index 92879fb..789fea4 100644
--- a/src/git.h
+++ b/src/git.h
@@ -251,7 +251,7 @@ private:
 	bool startParseProc(SCList initCmd, FileHistory* fh, SCRef buf);
 	bool tryFollowRenames(FileHistory* fh);
 	bool populateRenamedPatches(SCRef sha, SCList nn, FileHistory* fh,
QStringList* on, bool bt);
-	void doEarlyOutput(Rev* rev, int* start);
+	void doEarlyOutput(Rev* rev, const QByteArray& ba, int* start);
 	int addChunk(FileHistory* fh, const QByteArray& ba, int ofs);
 	void parseDiffFormat(RevFile& rf, SCRef buf);
 	void parseDiffFormatLine(RevFile& rf, SCRef line, int parNum);
diff --git a/src/git_startup.cpp b/src/git_startup.cpp
index df272fc..090d5f9 100644
--- a/src/git_startup.cpp
+++ b/src/git_startup.cpp
@@ -841,10 +841,10 @@ void Git::loadFileNames() {
 	indexTree();
 }

-void Git::doEarlyOutput(Rev* rev, int* start) {
+void Git::doEarlyOutput(Rev* rev, const QByteArray& ba, int* start) {

 	delete rev;
-	*start += QString("Final output:\n").length();
+	*start = ba.indexOf('\n', *start) + 1;

 	Rev* cl = NULL;
 	const Rev* r = revLookup(ZERO_SHA);
@@ -870,7 +870,7 @@ int Git::addChunk(FileHistory* fh, const
QByteArray& ba, int start) {
 		rev = new Rev(ba, start, fh->revOrder.count(), &nextStart,
!isMainHistory(fh));

 		if (nextStart == -2)
-			doEarlyOutput(rev, &start);
+			doEarlyOutput(rev, ba, &start);

 	} while (nextStart == -2);

@@ -1377,8 +1377,8 @@ int Rev::indexData(bool quick, bool withDiff) const {
 	if (start > last) // offset 'start' points to the char after "commit "
 		return -1;

-	if (uint(ba.at(start) == 'u'))
-		return -2; // "Final output:", let caller handle this
+	if (uint(ba.at(start) == 'u')) // "Final output:", let caller handle this
+		return (ba.indexOf('\n', start) != -1 ? -2 : -1);

 	// take in account --boundary and --left-right options
 	startOfs = uint(ba.at(start) == '-' || ba.at(start) == '<' ||
ba.at(start) == '>');
-- 
1.5.3.5.565.g985b6

                 reply	other threads:[~2007-11-04 20:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=e5bfff550711041250p1c48910fqa631cd7fd3c505f8@mail.gmail.com \
    --to=mcostalba@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=torvalds@linux-foundation.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.
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).