{"action":"created","issue":{"url":"https://api.github.com/repos/magit/magit/issues/2049","labels_url":"https://api.github.com/repos/magit/magit/issues/2049/labels{/name}","comments_url":"https://api.github.com/repos/magit/magit/issues/2049/comments","events_url":"https://api.github.com/repos/magit/magit/issues/2049/events","html_url":"https://github.com/magit/magit/issues/2049","id":94419171,"number":2049,"title":"magit causes git to hog CPU by running \"git update-index\" with tons of input files","user":{"login":"mgalgs","id":152014,"avatar_url":"https://avatars.githubusercontent.com/u/152014?v=3","gravatar_id":"","url":"https://api.github.com/users/mgalgs","html_url":"https://github.com/mgalgs","followers_url":"https://api.github.com/users/mgalgs/followers","following_url":"https://api.github.com/users/mgalgs/following{/other_user}","gists_url":"https://api.github.com/users/mgalgs/gists{/gist_id}","starred_url":"https://api.github.com/users/mgalgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgalgs/subscriptions","organizations_url":"https://api.github.com/users/mgalgs/orgs","repos_url":"https://api.github.com/users/mgalgs/repos","events_url":"https://api.github.com/users/mgalgs/events{/privacy}","received_events_url":"https://api.github.com/users/mgalgs/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/magit/magit/labels/01%20unconfirmed","name":"01 unconfirmed","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/magit/magit/milestones/19","html_url":"https://github.com/magit/magit/milestones/2.3.0","labels_url":"https://api.github.com/repos/magit/magit/milestones/19/labels","id":1203589,"number":19,"title":"2.3.0","description":"","creator":{"login":"tarsius","id":25046,"avatar_url":"https://avatars.githubusercontent.com/u/25046?v=3","gravatar_id":"","url":"https://api.github.com/users/tarsius","html_url":"https://github.com/tarsius","followers_url":"https://api.github.com/users/tarsius/followers","following_url":"https://api.github.com/users/tarsius/following{/other_user}","gists_url":"https://api.github.com/users/tarsius/gists{/gist_id}","starred_url":"https://api.github.com/users/tarsius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarsius/subscriptions","organizations_url":"https://api.github.com/users/tarsius/orgs","repos_url":"https://api.github.com/users/tarsius/repos","events_url":"https://api.github.com/users/tarsius/events{/privacy}","received_events_url":"https://api.github.com/users/tarsius/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":1,"state":"open","created_at":"2015-07-11T22:11:39Z","updated_at":"2015-07-16T13:27:21Z","due_on":"2015-08-21T22:00:00Z","closed_at":null},"comments":18,"created_at":"2015-07-11T00:36:00Z","updated_at":"2015-07-21T00:44:20Z","closed_at":null,"body":"It looks like magit is calling `git update-index`, passing what appears to be every file in my repository.  Based on some observations of the offending sub-processes being created (see below) the offending code appears to be `(magit-update-files)`.  While working on the Linux kernel this completely hangs emacs for up to a minute.\r\n\r\nI've noticed this while staging changes after resolving merge conflicts and also while stashing.  Looking at the call sites for `(magit-update-files)` I don't see how this can possibly happen...  Any ideas?\r\n\r\nHere's the (truncated) command line scraped from `ps` during one such hang while trying to stage a file where I had just finished resolving some merge conflicts:\r\n\r\n```\r\nps -ef | grep git\r\nmitchelh  2792 29644  7 17:15 ?        00:00:03 /usr/sbin/git --no-pager --literal-pathspecs -c core.preloadindex=true update-index --add --remove -- .gitignore .mailmap AndroidKernel.mk COPYING CREDITS Documentation/00-INDEX Documentation/ABI/README Documentation/ABI/obsolete/proc-sys-vm-nr_pdflush_threads Documentation/ABI/obsolete/sysfs-bus-usb Documentation/ABI/obsolete/sysfs-class-rfkill Documentation/ABI/obsolete/sysfs-driver-hid-roccat-koneplus Documentation/ABI/obsolete/sysfs-driver-hid-roccat-kovaplus Documentation/ABI/obsolete/sysfs-driver-hid-roccat-pyra Documentation/ABI/removed/devfs Documentation/ABI/removed/dv1394 Documentation/ABI/removed/ip_queue Documentation/ABI/removed/net_dma Documentation/ABI/removed/o2cb Documentation/ABI/removed/raw1394 Documentation/ABI/removed/video1394 Documentation/ABI/stable/firewire-cdev Documentation/ABI/stable/o2cb Documentation/ABI/stable/syscalls Documentation/ABI/stable/sysfs-acpi-pmprofile Documentation/ABI/stable/sysfs-bus-firewire Documentation/ABI/stable/sysfs-bus-usb Documentation/ABI/stable/sysfs-bus-xen-backend Documentation/ABI/stable/sysfs-class-backlight Documentation/ABI/stable/sysfs-class-rfkill Documentation/ABI/stable/sysfs-class-tpm Documentation/ABI/stable/sysfs-class-ubi Documentation/ABI/stable/sysfs-devices-node Documentation/ABI/stable/sysfs-devices-system-cpu Documentation/ABI/stable/sysfs-devices-system-xen_memory Documentation/ABI/stable/sysfs-driver-ib_srp Documentation/ABI/stable/sysfs-driver-qla2xxx Documentation/ABI/stable/sysfs-driver-usb-usbtmc Documentation/ABI/stable/sysfs-driver-w1_ds28e04 Documentation/ABI/stable/sysfs-firmware-efi-vars Documentation/ABI/stable/sysfs-firmware-opal-dump Documentation/ABI/stable/sysfs-firmware-opal-elog Documentation/ABI/stable/sysfs-module Documentation/ABI/stable/sysfs-transport-srp Documentation/ABI/stable/thermal-notification Documentation/ABI/stable/vdso Documentation/ABI/testing/configfs-spear-pcie-gadget Documentation/ABI/testing/configfs-usb-gadget Documentation/ABI/testing/configfs-usb-gadget-acm Documentation/ABI/testing/configfs-usb-gadget-ecm Documentation/ABI/testing/configfs-usb-gadget-eem Documentation/ABI/testing/configfs-usb-gadget-ffs Documentation/ABI/testing/configfs-usb-gadget-loopback Documentation/ABI/testing/configfs-usb-gadget-mass-storage Documentation/ABI/testing/configfs-usb-gadget-ncm Documentation/ABI/testing/configfs-usb-gadget-obex Documentation/ABI/testing/configfs-usb-gadget-phonet Documentation/ABI/testing/configfs-usb-gadget-rndis Documentation/ABI/testing/configfs-usb-gadget-serial Documentation/ABI/testing/configfs-usb-gadget-sourcesink Documentation/ABI/testing/configfs-usb-gadget-subset Documentation/ABI/testing/configfs-usb-gadget-uac1 Documentation/ABI/testing/configfs-usb-gadget-uac2 Documentation/ABI/testing/debugfs-driver-genwqe Documentation/ABI/testing/debugfs-ec Documentation/ABI/testing/debugfs-ideapad Documentation/ABI/testing/debugfs-olpc Documentation/ABI/testing/debugfs-pfo-nx-crypto Documentation/ABI/testing/debugfs-pktcdvd Documentation/ABI/testing/dev-kmsg Documentation/ABI/testing/evm Documentation/ABI/testing/ima_policy Documentation/ABI/testing/procfs-diskstats Documentation/ABI/testing/pstore Documentation/ABI/testing/sysfs-ata Documentation/ABI/testing/sysfs-block Documentation/ABI/testing/sysfs-block-bcache Documentation/ABI/testing/sysfs-block-dm Documentation/ABI/testing/sysfs-block-rssd Documentation/ABI/testing/sysfs-block-zram Documentation/ABI/testing/sysfs-bus-acpi Documentation/ABI/testing/sysfs-bus-bcma Documentation/ABI/testing/sysfs-bus-css Documentation/ABI/testing/sysfs-bus-event_source-devices-events Documentation/ABI/testing/sysfs-bus-event_source-devices-format Documentation/ABI/testing/sysfs-bus-event_source-devices-hv_24x7 Documentation/ABI/testing/sysfs-bus-event_source-devices-hv_gpci Documentation/ABI/testing/sysfs-bus-fcoe Documentation/ABI/testing/sysfs-bus-hsi Documentation/ABI/testing/sysfs-bus-i2c-devices-fsa9480 Documentation/ABI/testing/sysfs-bus-i2c-devices-hm6352 Documentation/ABI/testing/sysfs-bus-i2c-devices-lm3533 Documentation/ABI/testing/sysfs-bus-iio Docume\r\n```"},"comment":{"url":"https://api.github.com/repos/magit/magit/issues/comments/123111518","html_url":"https://github.com/magit/magit/issues/2049#issuecomment-123111518","issue_url":"https://api.github.com/repos/magit/magit/issues/2049","id":123111518,"user":{"login":"tarsius","id":25046,"avatar_url":"https://avatars.githubusercontent.com/u/25046?v=3","gravatar_id":"","url":"https://api.github.com/users/tarsius","html_url":"https://github.com/tarsius","followers_url":"https://api.github.com/users/tarsius/followers","following_url":"https://api.github.com/users/tarsius/following{/other_user}","gists_url":"https://api.github.com/users/tarsius/gists{/gist_id}","starred_url":"https://api.github.com/users/tarsius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarsius/subscriptions","organizations_url":"https://api.github.com/users/tarsius/orgs","repos_url":"https://api.github.com/users/tarsius/repos","events_url":"https://api.github.com/users/tarsius/events{/privacy}","received_events_url":"https://api.github.com/users/tarsius/received_events","type":"User","site_admin":false},"created_at":"2015-07-21T00:44:20Z","updated_at":"2015-07-21T00:44:20Z","body":"Are you using MS Windows?"}}