{"thread":{"id":"25928","subject":"cannot find hash in the log output","startedAt":"2010-12-02T19:57:08Z","lastAt":"2010-12-04T01:08:45Z","messageCount":14,"participants":["Eugene Sajine","Junio C Hamano","Jeff King","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"157152","messageId":"AANLkTi=5b26aPLm_Byqg=c9=sPpg5jEPDDpf1J9WgOdY@mail.gmail.com","threadId":"25928","inReplyTo":null,"subject":"cannot find hash in the log output","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2010-12-02T19:57:08Z","receivedAt":"2010-12-02T19:57:08Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"Hi,\n\nI have a strange issue (git v 1.7.3.2). I'm cloning the repository,\nnavigating to the folder containing some scripts and performing\ngit hash-object <one_of_my_scripts>\n\nThen I'm trying to run:\n\ngit log --raw --no-abbrev | grep <resulting SHA1 from previous command>\n\nAnd i don't see anything.\n\nHow is that possible, considering no local changes to the file has\nbeen done, working directory clean?? How could the file get into this\nstate?\n\nThanks,\nEugene\n"},{"id":"157153","messageId":"7v8w07rje3.fsf@alter.siamese.dyndns.org","threadId":"25928","inReplyTo":"AANLkTi=5b26aPLm_Byqg=c9=sPpg5jEPDDpf1J9WgOdY@mail.gmail.com","subject":"Re: cannot find hash in the log output","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-12-02T20:48:20Z","receivedAt":"2010-12-02T20:48:20Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eugene Sajine <euguess@gmail.com> writes:\n\n> I have a strange issue (git v 1.7.3.2). I'm cloning the repository,\n> navigating to the folder containing some scripts and performing\n> git hash-object <one_of_my_scripts>\n>\n> Then I'm trying to run:\n>\n> git log --raw --no-abbrev | grep <resulting SHA1 from previous command>\n>\n> And i don't see anything.\n\nDo you see it in the output from \"git ls-tree -r HEAD\"?\n"},{"id":"157155","messageId":"AANLkTimExbMn4-E-zuAGmi+p1wNAHoetpeyr2SK6vGxk@mail.gmail.com","threadId":"25928","inReplyTo":"7v8w07rje3.fsf@alter.siamese.dyndns.org","subject":"Re: cannot find hash in the log output","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2010-12-02T21:07:20Z","receivedAt":"2010-12-02T21:07:20Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"On Thu, Dec 2, 2010 at 3:48 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Eugene Sajine <euguess@gmail.com> writes:\n>\n>> I have a strange issue (git v 1.7.3.2). I'm cloning the repository,\n>> navigating to the folder containing some scripts and performing\n>> git hash-object <one_of_my_scripts>\n>>\n>> Then I'm trying to run:\n>>\n>> git log --raw --no-abbrev | grep <resulting SHA1 from previous command>\n>>\n>> And i don't see anything.\n>\n> Do you see it in the output from \"git ls-tree -r HEAD\"?\n>\n\n\nyes. I do see it with your command.\n\ngit ls-tree -r HEAD | grep <resulting SHA1 from git hash-object>\n\nThanks,\nEugene\n"},{"id":"157226","messageId":"AANLkTinAUfFge-AcfQevG2_9Gi3oOPy+-SrEZrfp4byn@mail.gmail.com","threadId":"25928","inReplyTo":"AANLkTimExbMn4-E-zuAGmi+p1wNAHoetpeyr2SK6vGxk@mail.gmail.com","subject":"Re: cannot find hash in the log output","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2010-12-03T17:41:52Z","receivedAt":"2010-12-03T17:41:52Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"On Thu, Dec 2, 2010 at 4:07 PM, Eugene Sajine <euguess@gmail.com> wrote:\n> On Thu, Dec 2, 2010 at 3:48 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Eugene Sajine <euguess@gmail.com> writes:\n>>\n>>> I have a strange issue (git v 1.7.3.2). I'm cloning the repository,\n>>> navigating to the folder containing some scripts and performing\n>>> git hash-object <one_of_my_scripts>\n>>>\n>>> Then I'm trying to run:\n>>>\n>>> git log --raw --no-abbrev | grep <resulting SHA1 from previous command>\n>>>\n>>> And i don't see anything.\n>>\n>> Do you see it in the output from \"git ls-tree -r HEAD\"?\n>>\n>\n>\n> yes. I do see it with your command.\n>\n> git ls-tree -r HEAD | grep <resulting SHA1 from git hash-object>\n>\n> Thanks,\n> Eugene\n>\n\nWhile I'm able to see that object using the command Junio has provided\nthe question remains the same:\nHow could the file get into the state where its hash (git has-object\nfile-name) cannot be found in any commit (git log --raw --no-abbrev |\ngrep SHA1), if there was no local changes made to the file???\n\nThanks,\nEugene\n"},{"id":"157228","messageId":"20101203175212.GA8267@sigill.intra.peff.net","threadId":"25928","inReplyTo":"AANLkTinAUfFge-AcfQevG2_9Gi3oOPy+-SrEZrfp4byn@mail.gmail.com","subject":"Re: cannot find hash in the log output","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-12-03T17:52:13Z","receivedAt":"2010-12-03T17:52:13Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Dec 03, 2010 at 12:41:52PM -0500, Eugene Sajine wrote:\n\n> > yes. I do see it with your command.\n> >\n> > git ls-tree -r HEAD | grep <resulting SHA1 from git hash-object>\n> >\n> > Thanks,\n> > Eugene\n> >\n> \n> While I'm able to see that object using the command Junio has provided\n> the question remains the same:\n> How could the file get into the state where its hash (git has-object\n> file-name) cannot be found in any commit (git log --raw --no-abbrev |\n> grep SHA1), if there was no local changes made to the file???\n\nIf the blob was created as the resolution of a merge conflict, I don't\nthink that will appear in the output of \"git log --raw\".\n\n-Peff\n"},{"id":"157251","messageId":"AANLkTim59JP-fuVTeLwxV0bktbdCq04P8XzxVmbu2Qjd@mail.gmail.com","threadId":"25928","inReplyTo":"20101203175212.GA8267@sigill.intra.peff.net","subject":"Re: cannot find hash in the log output","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2010-12-03T20:10:40Z","receivedAt":"2010-12-03T20:10:40Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"On Fri, Dec 3, 2010 at 12:52 PM, Jeff King <peff@peff.net> wrote:\n> On Fri, Dec 03, 2010 at 12:41:52PM -0500, Eugene Sajine wrote:\n>\n>> > yes. I do see it with your command.\n>> >\n>> > git ls-tree -r HEAD | grep <resulting SHA1 from git hash-object>\n>> >\n>> > Thanks,\n>> > Eugene\n>> >\n>>\n>> While I'm able to see that object using the command Junio has provided\n>> the question remains the same:\n>> How could the file get into the state where its hash (git has-object\n>> file-name) cannot be found in any commit (git log --raw --no-abbrev |\n>> grep SHA1), if there was no local changes made to the file???\n>\n> If the blob was created as the resolution of a merge conflict, I don't\n> think that will appear in the output of \"git log --raw\".\n>\n> -Peff\n>\n\nYes this does make sense to me. Although it is not necessary to have\nconflicts during the merge - recursive merge as i understand also can\ncreate new blobs.\nNow as this is pretty much clear: don't you think that the information\nabout one blob content changed during the merge should be present in\nthe merge commit info?\nIt seems strange that git log <filename> contains merge commit, but\ngit whatchanged <filename> doesn't show the merge commit, while this\nmerge commit actually had a change of content in the file,  and\nfinally \"git log --raw <filename>\" does list the merge commit but is\nnot showing that particular blob had a change and now has a new SHA1?\n\nIMHO everytime there is a change in the content this change should be\nlogged properly.\n\nThanks,\nEugene\n"},{"id":"157254","messageId":"20101203202923.GB15517@burratino","threadId":"25928","inReplyTo":"AANLkTim59JP-fuVTeLwxV0bktbdCq04P8XzxVmbu2Qjd@mail.gmail.com","subject":"Re: cannot find hash in the log output","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-12-03T20:29:24Z","receivedAt":"2010-12-03T20:29:24Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Eugene Sajine wrote:\n\n> Now as this is pretty much clear: don't you think that the information\n> about one blob content changed during the merge should be present in\n> the merge commit info?\n\n\"git rev-list <revs> | git diff-tree --root -c --stdin\" might give\nsome joy.\n"},{"id":"157258","messageId":"AANLkTin94XN8_+q8a1EdfY3ySqJpx_j9megQYsq8a8ux@mail.gmail.com","threadId":"25928","inReplyTo":"20101203202923.GB15517@burratino","subject":"Re: cannot find hash in the log output","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2010-12-03T20:53:20Z","receivedAt":"2010-12-03T20:53:20Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"On Fri, Dec 3, 2010 at 3:29 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Eugene Sajine wrote:\n>\n>> Now as this is pretty much clear: don't you think that the information\n>> about one blob content changed during the merge should be present in\n>> the merge commit info?\n>\n> \"git rev-list <revs> | git diff-tree --root -c --stdin\" might give\n> some joy.\n>\n\nAllright, this is much closer now;) I used\n\ngit rev-list HEAD | git diff-tree --root -c --stdin | grep <SHA1 of\nblob interest>\n\n(I need to read now about diff-tree)\nThat gives me the output like this:\n\n::SourceMode1 SourceMode2 resultMode Source1-SHA1 Source2-SHA1\nresultingSHA1 MM path/to/file\n\n\nNow two questions:\n\n1. a) Why this exact output is not provided in \"git log --raw\" or in\n\"git whatchanged\" for the merge commits? b) Can it be provided?\n2. If 1b=no Is this the ultimate final solution to check if the blob\nhas appeared somewhere in the history?\n\n\nThanks!\nEugene\n"},{"id":"157259","messageId":"20101203205534.GA15658@burratino","threadId":"25928","inReplyTo":"AANLkTin94XN8_+q8a1EdfY3ySqJpx_j9megQYsq8a8ux@mail.gmail.com","subject":"Re: cannot find hash in the log output","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-12-03T20:55:34Z","receivedAt":"2010-12-03T20:55:34Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Eugene Sajine wrote:\n\n> ::SourceMode1 SourceMode2 resultMode Source1-SHA1 Source2-SHA1 resultingSHA1 MM path/to/file\n[...]\n> 1. a) Why this exact output is not provided in \"git log --raw\" or in\n> \"git whatchanged\" for the merge commits? b) Can it be provided?\n\nSorry to be opaque.  \"git log\" et al accept -c too, of course. :)  I pointed\nto diff-tree because it seems you are scripting, so its simplicity and\nbetter guarantees about long-term compatibility might be appealing.\n\nCheers,\nJonathan\n"},{"id":"157261","messageId":"AANLkTinnwM0h_TiLW0oXVmSrv25HMu4oZm8ZBcBOZ8r3@mail.gmail.com","threadId":"25928","inReplyTo":"20101203205534.GA15658@burratino","subject":"Re: cannot find hash in the log output","fromName":"Eugene Sajine","fromEmail":"euguess@gmail.com","sentAt":"2010-12-03T21:01:07Z","receivedAt":"2010-12-03T21:01:07Z","isPatch":false,"sender":{"key":"euguess@gmail.com","avatar":null},"body":"On Fri, Dec 3, 2010 at 3:55 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:\n> Eugene Sajine wrote:\n>\n>> ::SourceMode1 SourceMode2 resultMode Source1-SHA1 Source2-SHA1 resultingSHA1 MM path/to/file\n> [...]\n>> 1. a) Why this exact output is not provided in \"git log --raw\" or in\n>> \"git whatchanged\" for the merge commits? b) Can it be provided?\n>\n> Sorry to be opaque.  \"git log\" et al accept -c too, of course. :)  I pointed\n> to diff-tree because it seems you are scripting, so its simplicity and\n> better guarantees about long-term compatibility might be appealing.\n>\n> Cheers,\n> Jonathan\n>\n\nWow! that is pretty cool - it is one of the diff options that log\nunderstands... interesting...\nThank you very much!\n\nEugene\n"},{"id":"157262","messageId":"7vfwueo9ie.fsf@alter.siamese.dyndns.org","threadId":"25928","inReplyTo":"20101203205534.GA15658@burratino","subject":"Re: cannot find hash in the log output","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-12-03T21:02:17Z","receivedAt":"2010-12-03T21:02:17Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n>> ::SourceMode1 SourceMode2 resultMode Source1-SHA1 Source2-SHA1 resultingSHA1 MM path/to/file\n> [...]\n>> 1. a) Why this exact output is not provided in \"git log --raw\" or in\n>> \"git whatchanged\" for the merge commits? b) Can it be provided?\n>\n> Sorry to be opaque.  \"git log\" et al accept -c too, of course. :)  I pointed\n> to diff-tree because it seems you are scripting, so its simplicity and\n> better guarantees about long-term compatibility might be appealing.\n\nTwo nits if this is really to help scripters.\n\n - Both -c and --cc cull merges uninteresting at the file level; if the\n   script _really_ wants to view the whole history, giving -m would be\n   more appropriate.\n\n - The default history traversal is --dense and also with merge\n   simplification turned on; again, if the script _really_ wants to view\n   the whole history, --sparse and/or --full-history would be necessary\n   depending on the needs.\n"},{"id":"157266","messageId":"20101203211158.GA2632@sigill.intra.peff.net","threadId":"25928","inReplyTo":"AANLkTim59JP-fuVTeLwxV0bktbdCq04P8XzxVmbu2Qjd@mail.gmail.com","subject":"Re: cannot find hash in the log output","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-12-03T21:11:58Z","receivedAt":"2010-12-03T21:11:58Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Dec 03, 2010 at 03:10:40PM -0500, Eugene Sajine wrote:\n\n> Yes this does make sense to me. Although it is not necessary to have\n> conflicts during the merge - recursive merge as i understand also can\n> create new blobs.\n\nI haven't thought about it too hard, but I don't see why any merge would\ncreate a new blob unless there is a conflict. Otherwise you are always\ntaking one of the blobs that already exists in some other part of\nhistory.\n\n> Now as this is pretty much clear: don't you think that the information\n> about one blob content changed during the merge should be present in\n> the merge commit info?\n\nNo. We suppress \"uninteresting\" parts of merges by default because they\nare mostly clutter. If you really want to see them, use \"-m\".\n\n> It seems strange that git log <filename> contains merge commit, but\n> git whatchanged <filename> doesn't show the merge commit, while this\n> merge commit actually had a change of content in the file,\n\nThe fact that git whatchanged does not show merge commits by default is\njust historical. There is really no need for whatchanged to exist at all\nthese days, now that \"git log\" can do diffs internally. In fact, it is\nsimply implemented these days as \"git log\" with a few different\ndefaults.\n\n-Peff\n"},{"id":"157272","messageId":"20101203215244.GA4278@sigill.intra.peff.net","threadId":"25928","inReplyTo":"20101203211158.GA2632@sigill.intra.peff.net","subject":"Re: cannot find hash in the log output","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-12-03T21:52:44Z","receivedAt":"2010-12-03T21:52:44Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Dec 03, 2010 at 04:11:58PM -0500, Jeff King wrote:\n\n> > Yes this does make sense to me. Although it is not necessary to have\n> > conflicts during the merge - recursive merge as i understand also can\n> > create new blobs.\n> \n> I haven't thought about it too hard, but I don't see why any merge would\n> create a new blob unless there is a conflict. Otherwise you are always\n> taking one of the blobs that already exists in some other part of\n> history.\n\nEr, sorry, this is totally wrong. For some reason I said \"conflict\"\n(repeatedly) when I meant \"trivial merge\". I guess my brain is not\nworking today.\n\nAny time you have to do file-level merging (i.e., because both sides\nof the merge touched that path) you will create a new blob, conflicts or\nno.\n\n-Peff\n"},{"id":"157286","messageId":"20101204010845.GC15906@burratino","threadId":"25928","inReplyTo":"7vfwueo9ie.fsf@alter.siamese.dyndns.org","subject":"Re: cannot find hash in the log output","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2010-12-04T01:08:45Z","receivedAt":"2010-12-04T01:08:45Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n\n> Two nits if this is really to help scripters.\n> \n>  - Both -c and --cc cull merges uninteresting at the file level; if the\n>    script _really_ wants to view the whole history, giving -m would be\n>    more appropriate.\n> \n>  - The default history traversal is --dense and also with merge\n>    simplification turned on; again, if the script _really_ wants to view\n>    the whole history, --sparse and/or --full-history would be necessary\n>    depending on the needs.\n\nIn a \"tree blame\" script:\n\n - silence when a file was not changed from at least one parent is\n   perfectly appropriate --- that is not the birth of a blob;\n - --dense versus --sparse shouldn't affect the output if the\n   rev-list and diff-tree are limited in the same way;\n - history simplification is probably appropriate --- blind alleys\n   are not needed to explain the origin of this blob.\n\nOn the other hand, a \"lifetime of this content\" script would have very\ndifferent requirements ---\n\n - changes from all parents would need to be tracked, requiring -m;\n - --dense versus --sparse would still not matter, but:\n - history simplification would be inappropriate, anyway --- blind\n   alleys ought to be investigated in case the content made a brief\n   appearance some time in the past.\n\n--- making the options you mention quite relevant.  Thanks.\n"}]}