From: Steffen Prohaska <prohaska@zib.de>
To: git@vger.kernel.org
Cc: Steffen Prohaska <prohaska@zib.de>
Subject: [PATCH] gitk: Add workaround to handle corrupted author date
Date: Sun, 2 Dec 2007 17:36:23 +0100 [thread overview]
Message-ID: <1196613383337-git-send-email-prohaska@zib.de> (raw)
In-Reply-To: <5F1A20CC-7427-4E7A-AB95-E89C9FA17951@zib.de>
6e6db85ea9423eea755cf5acf7a563c0d9559063 contains a corrupted
author line, which is lacking the time and timezone information.
This commit adds a workaround to handle this situation. If the
time cannot be parsed, it is assumed to be 0 and the full line
is assumed to be the author's name.
---
gitk | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
This works around the issue for me. However, I don't think
this patch should be applied.
The best was if such a corrupted commit wouldn't enter the
repository in the first place. But once it is there, I think git
should verify the format of a commit and report an approriate
error. gitk could continue to assume well formed commits.
Steffen
diff --git a/gitk b/gitk
index 1da0b0a..873766c 100755
--- a/gitk
+++ b/gitk
@@ -439,7 +439,12 @@ proc parsecommit {id contents listed} {
set tag [lindex $line 0]
if {$tag == "author"} {
set audate [lindex $line end-1]
- set auname [lrange $line 1 end-2]
+ if {[catch {formatdate $audate}]} {
+ set audate 0
+ set auname [lrange $line 1 end]
+ } else {
+ set auname [lrange $line 1 end-2]
+ }
} elseif {$tag == "committer"} {
set comdate [lindex $line end-1]
set comname [lrange $line 1 end-2]
--
1.5.3.7.949.g2221a6
next prev parent reply other threads:[~2007-12-02 16:36 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-02 16:06 Corrupted (?) commit 6e6db85e confusing gitk Steffen Prohaska
2007-12-02 16:12 ` Wincent Colaiuta
2007-12-02 16:36 ` Steffen Prohaska [this message]
2007-12-02 18:53 ` Junio C Hamano
2007-12-02 19:39 ` Brian Downing
2007-12-02 20:34 ` Linus Torvalds
2007-12-02 20:48 ` Junio C Hamano
2007-12-02 21:25 ` Linus Torvalds
2007-12-02 21:47 ` Junio C Hamano
2007-12-02 22:43 ` Linus Torvalds
2007-12-02 21:43 ` Fix --signoff in builtin-commit differently Junio C Hamano
2007-12-02 22:31 ` Johannes Schindelin
2007-12-02 22:59 ` Corrupted (?) commit 6e6db85e confusing gitk Michael Gebetsroither
2007-12-02 23:05 ` Junio C Hamano
2007-12-02 21:34 ` Johannes Schindelin
2007-12-02 21:49 ` Linus Torvalds
2007-12-02 22:36 ` Junio C Hamano
2007-12-02 22:14 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1196613383337-git-send-email-prohaska@zib.de \
--to=prohaska@zib.de \
--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.
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).