1

When I try to see the Git History by the Visual Studio I get the following error message.

After run the command git fschk I could identify the following error that is caused because the commit doesn't have information about author and the date information.

error in commit 8b47c4645d38edf9f8d104c3b6cc9e015fd5cdd4:
 missingEmail: invalid author/committer line - missing email

And after try get the commit history on gitk

expected integer but got "Bruno" 
expected integer but got "Bruno"
    while executing
"ParseFormatArgs {*}$args"
    (procedure "::tcl::clock::format" line 6)
    invoked from within
"clock format [lindex $d 0] -format $datetimeformat"
    (procedure "formatdate" line 25)
    invoked from within
"formatdate [lindex $info 2]"
    (procedure "selectline" line 87)
    invoked from within
"selectline $l 1"
    (procedure "selcanvline" line 18)
    invoked from within
"selcanvline .tf.histframe.pwclist.canv 189 109"
    (command bound to event)

How could I can fix that?

alroc
  • 27,574
  • 6
  • 51
  • 97
  • Yes, you have a bad commit (made by software that did not follow the internal rules) and some of your tools cannot deal with it. What is your *question*, though? – torek Dec 28 '16 at 18:28
  • How I could fix the information about this registry? – Nero Rodrigues Dec 28 '16 at 18:45

1 Answers1

4

Unfortunately, (1) gitk cannot deal with a bad commit and (2) you cannot change any commit. This leaves you with two options (other than "don't use the tool that can't deal with the problem"):

  • Actually fix the problem: Copy the repository to a new, different repository that does not have a bad commit. If this repository is new, so that others are not depending on commit hash IDs taken from it, this is probably the best approach. (You have, for some reason, tagged this as well as , so note that I have no experience with converting back and forth between the two, and what happens if you rewrite a converted repository, but I would expect that not to work well.)

    This generally requires running git filter-branch, which is somewhat tricky to use. Search StackOverflow for examples of using filter-branch, or see the linked question at the bottom.

  • Paper over the problem: Use git replace to put in a substitute commit for the bad commit. The substitute commit will be exactly like the bad commit except that it will have valid author and committer lines. When Git goes to look at the bad original commit, it will turn its "eyes" to the replacement instead and see the good commit instead. The drawback to replacements is that they are not automatically copied to new clones (they can be manually copied afterward, though).

Note that one way, perhaps the easiest, to actually fix the problem is to use git replace to paper over it, then git filter-branch to make the replacement permanent. This is similar to the use of grafts shown in VonC's answer to What does git filter-branch with no arguments do?

Community
  • 1
  • 1
torek
  • 448,244
  • 59
  • 642
  • 775