{"thread":{"id":"1577","subject":"git-whatchanged -p anomoly?","startedAt":"2005-08-18T20:49:07Z","lastAt":"2005-08-18T22:31:40Z","messageCount":4,"participants":["Luck, Tony","Linus Torvalds","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"7516","messageId":"200508182049.j7IKn7TA010456@agluck-lia64.sc.intel.com","threadId":"1577","inReplyTo":null,"subject":"git-whatchanged -p anomoly?","fromName":"Luck, Tony","fromEmail":"tony.luck@intel.com","sentAt":"2005-08-18T20:49:07Z","receivedAt":"2005-08-18T20:49:07Z","isPatch":false,"sender":{"key":"tony.luck@intel.com","avatar":"https://avatars.githubusercontent.com/u/5446021?v=4"},"body":"Yesterday I was all happy ... Linus pulled a couple of changes from\nmy tree, and after I did a pull back from his tree into my \"linus\"\ntracking branch, my status scripts correctly identified the branches\nthat I'd been using to track those changes as being no longer needed.\n\nBut this morning I ran another one of my status scripts that does\n\n $ git-whatchanged -p test ^linus | diffstat -p1\n\nand was surprised when it reported changes in 10 files that I knew\nI hadn't touched (the other 18 files it reported looked correct).\n\nSo I ran:\n\n $ git-whatchanged test ^linus | git-shortlog\n\nand this just reported the changesets that I expected.\n\n $ git-diff-tree -p linus test | diffstat -p1\n\nshows what I expect to see.\n\nThe current heads of the two branches are:\n\nlinus=30d5b64b63fa69af31b2cba32e6d71d68526eec9\ntest=0e595ad82db1b42d631e581630eb3fbeebb3c285\n\nmy tree is at:\nrsync://rsync.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6.git\n\nThe spurious changes reported by \"git-whatchanged -p\" are:\n\n>  Documentation/acpi-hotkey.txt              |    3 \n>  Documentation/kernel-parameters.txt        |    5 \n>  drivers/acpi/osl.c                         |    6 \n>  fs/jfs/inode.c                             |    4 \n>  fs/jfs/jfs_logmgr.c                        |   36 -\n>  fs/jfs/jfs_logmgr.h                        |    2 \n>  fs/jfs/jfs_txnmgr.c                        |   12 \n>  fs/jfs/super.c                             |    4 \n>  include/asm-i386/processor.h               |    2 \n>  include/asm-x86_64/processor.h             |    2 \n\nIs this a bug, or am I just confused about how \"git-whatchanged\" works?\n\n-Tony\n"},{"id":"7522","messageId":"Pine.LNX.4.58.0508181503200.3412@g5.osdl.org","threadId":"1577","inReplyTo":"200508182049.j7IKn7TA010456@agluck-lia64.sc.intel.com","subject":"Re: git-whatchanged -p anomoly?","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-08-18T22:10:33Z","receivedAt":"2005-08-18T22:10:33Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 18 Aug 2005, Luck, Tony wrote:\n> \n> The spurious changes reported by \"git-whatchanged -p\" are:\n> \n> >  Documentation/acpi-hotkey.txt              |    3 \n> >  Documentation/kernel-parameters.txt        |    5 \n> >  drivers/acpi/osl.c                         |    6 \n> >  fs/jfs/inode.c                             |    4 \n\n\nEhh. These are all from:\n\n\tAuthor: Alex Williamson <alex.williamson@hp.com>\n\n\t    [IA64, X86_64] fix swiotlb sizing\n\nin commit b63d6e09b432e6873d072a767c87218f8e73e66c.\n\nAnd you've signed off on it.\n\nDo a\n\n\tgit-diff-tree -p --pretty b63d6e09b432e6873d072a767c87218f8e73e66c | less -S\n\nto see it in all its glory.\n\nNow, I suspect you didn't mean to commit that thing: it really looks like \nyou've mixed up your patches somehow, because the commit message seems to \nmatch only a very small portion of the patch.\n\nDid you perhaps have a failed merge or something that was in your index \nwhen you applied that patch? If you have a dirty index when you do \n\"git-applymbox\", it the commit done as part of the applymbox might commit \nother state too.\n\n(git-applymbox _does_ verify that the files that it patches are up-to-date \nin the index, but it does _not_ verify that the index matches the current \nHEAD. I guess I could add a sanity check for that...)\n\n> Is this a bug, or am I just confused about how \"git-whatchanged\" works?\n\nIt's definitely not a bug in git-whatchanged, and I don't think you're \nconfused about how git-whatchanged is supposed to work. But I think you've \ncommitted a bad patch.\n\n\t\tLinus\n"},{"id":"7523","messageId":"7vacjehp0s.fsf@assigned-by-dhcp.cox.net","threadId":"1577","inReplyTo":"200508182049.j7IKn7TA010456@agluck-lia64.sc.intel.com","subject":"Re: git-whatchanged -p anomoly?","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-08-18T22:13:39Z","receivedAt":"2005-08-18T22:13:39Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Luck, Tony\" <tony.luck@intel.com> writes:\n\n>  $ git-whatchanged -p test ^linus | diffstat -p1\n>  $ git-diff-tree -p linus test | diffstat -p1\n\ngit-whatchanged internally uses git-rev-list which skips merge\ncommits.  You need '-m' to cause it not to.\n\n    $ git-whatchanged -m -p linus..test | diffstat -p1\n\nwould still not _match_ \"git-diff-tree -p linus test | diffstat\n-p1\" output because conflict-resolving merges inevitably causes\nthe same file to be touched twice (hence diffstat shows patches\nfor the same fime twice, adding up the count of the changes), so\nin practice, my \"use -m if you want to see merges\" advice would\nnot be much useful if you want to _count_ lines using diffstat.\n\nFor example, one of the files you had trouble with are touched\nby the following commits; only the last one is a non-merge and\nthat is what you get when you do not give -m to whatchanged:\n\n$ git-whatchanged -m --pretty=oneline test ^linus \\\n\t-p Documentation/acpi-hotkey.txt\n\ndiff-tree 75304b938dcc2cb89c2bb1174a92ffc76520a899 (from 470ceb05d9a2b4d61c19fac615a79e56e8401565)\nPull ngam-maule-steiner into test branch\ndiff --git a/Documentation/acpi-hotkey.txt b/Documentation/acpi-hotkey.txt\n--- a/Documentation/acpi-hotkey.txt\n+++ b/Documentation/acpi-hotkey.txt\n@@ -33,3 +33,6 @@ The result of the execution of this aml\n attached to /proc/acpi/hotkey/poll_method, which is dnyamically\n created.  Please use command \"cat /proc/acpi/hotkey/polling_method\"\n to retrieve it.\n+\n+Note: Use cmdline \"acpi_generic_hotkey\" to over-ride\n+loading any platform specific drivers.\n\ndiff-tree 2dbff4d454d3ee733f120ad531560a734a6e39d6 (from 715caa83e762c86241ae4450693bb969d03027c4)\nAuto-update from upstream\ndiff --git a/Documentation/acpi-hotkey.txt b/Documentation/acpi-hotkey.txt\n--- a/Documentation/acpi-hotkey.txt\n+++ b/Documentation/acpi-hotkey.txt\n@@ -33,3 +33,6 @@ The result of the execution of this aml\n attached to /proc/acpi/hotkey/poll_method, which is dnyamically\n created.  Please use command \"cat /proc/acpi/hotkey/polling_method\"\n to retrieve it.\n+\n+Note: Use cmdline \"acpi_generic_hotkey\" to over-ride\n+loading any platform specific drivers.\n\ndiff-tree f812175c8007fdb614833830ca107062df2845dd (from c1ffb910f7a4e1e79d462bb359067d97ad1a8a25)\nPull prarit-bus-sysdata into test branch\ndiff --git a/Documentation/acpi-hotkey.txt b/Documentation/acpi-hotkey.txt\n--- a/Documentation/acpi-hotkey.txt\n+++ b/Documentation/acpi-hotkey.txt\n@@ -33,6 +33,3 @@ The result of the execution of this aml\n attached to /proc/acpi/hotkey/poll_method, which is dnyamically\n created.  Please use command \"cat /proc/acpi/hotkey/polling_method\"\n to retrieve it.\n-\n-Note: Use cmdline \"acpi_generic_hotkey\" to over-ride\n-loading any platform specific drivers.\n\ndiff-tree b63d6e09b432e6873d072a767c87218f8e73e66c (from 12aaa0855b39b5464db953fedf399fa91ee365ed)\n[IA64, X86_64] fix swiotlb sizing\ndiff --git a/Documentation/acpi-hotkey.txt b/Documentation/acpi-hotkey.txt\n--- a/Documentation/acpi-hotkey.txt\n+++ b/Documentation/acpi-hotkey.txt\n@@ -33,6 +33,3 @@ The result of the execution of this aml\n attached to /proc/acpi/hotkey/poll_method, which is dnyamically\n created.  Please use command \"cat /proc/acpi/hotkey/polling_method\"\n to retrieve it.\n-\n-Note: Use cmdline \"acpi_generic_hotkey\" to over-ride\n-loading any platform specific drivers.\n"},{"id":"7524","messageId":"Pine.LNX.4.58.0508181527100.3412@g5.osdl.org","threadId":"1577","inReplyTo":"Pine.LNX.4.58.0508181503200.3412@g5.osdl.org","subject":"git-applymbox: verify that index is clean","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-08-18T22:31:40Z","receivedAt":"2005-08-18T22:31:40Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\nThis makes git-applymbox verify that the index matches the current HEAD \nbefore it starts applying patches.\n\nOtherwise, you might have updated the index with unrelated changes, and \nthe first patch will commit not just the patch from the mbox, but also any \nchanges you had in your index.\n\nSigned-off-by: Linus Torvalds <torvalds@osdl.org>\n----\n\nThis was brough on by: Tony Luck's problem, which _might_ be due to index\nfile change contents that got committed together with a real patch. This\nwill make it much harder to make that particular mistake.\n\nOn Thu, 18 Aug 2005, Linus Torvalds wrote:\n>\n> (git-applymbox _does_ verify that the files that it patches are up-to-date \n> in the index, but it does _not_ verify that the index matches the current \n> HEAD. I guess I could add a sanity check for that...)\n\ndiff --git a/tools/git-applymbox b/tools/git-applymbox\n--- a/tools/git-applymbox\n+++ b/tools/git-applymbox\n@@ -18,6 +18,8 @@\n ## use a Signoff_file, because applypatch wants to append the sign-off\n ## message to msg-clean every time it is run.\n \n+. git-sh-setup-script || die \"Not a git archive\"\n+\n keep_subject= query_apply= continue= resume=t\n while case \"$#\" in 0) break ;; esac\n do\n@@ -39,6 +41,12 @@ case \"$continue\" in\n \tshift\n esac\n \n+files=$(git-diff-cache --cached --name-only HEAD) || exit\n+if [ \"$files\" ]; then\n+   echo \"Dirty index: cannot apply patches (dirty: $files)\" >&2\n+   exit 1\n+fi\n+\n case \"$query_apply\" in\n t)\ttouch .dotest/.query_apply\n esac\n"}]}