git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH qgit] Update to latest --early-output git log patch
@ 2007-11-04 20:50 Marco Costalba
  0 siblings, 0 replies; only message in thread
From: Marco Costalba @ 2007-11-04 20:50 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Linus Torvalds

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-11-04 20:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-04 20:50 [PATCH qgit] Update to latest --early-output git log patch Marco Costalba

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).