{"thread":{"id":"16130","subject":"commit takes 8 secs; but instant when offline - can I fix this?","startedAt":"2008-11-02T14:08:14Z","lastAt":"2008-11-02T19:18:34Z","messageCount":4,"participants":["13ren","Thomas Rast","Brendan Macmillan","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"94659","messageId":"1225634894605-1445352.post@n2.nabble.com","threadId":"16130","inReplyTo":null,"subject":"commit takes 8 secs; but instant when offline - can I fix this?","fromName":"13ren","fromEmail":"melbourne.research@gmail.com","sentAt":"2008-11-02T14:08:14Z","receivedAt":"2008-11-02T14:08:14Z","isPatch":false,"sender":{"key":"melbourne.research@gmail.com","avatar":null},"body":"\nHi all,\n\nWith the network plugged in, git-commit takes 8 seconds.\n\nWhen I unplug the network, commit is instant...\n\nI confirmed this with a fresh test directory, just adding an extra line to\nthe file \"test\" for each commit:\n\n> git init\nInitialized empty Git repository in /home/user/gitexpt/.git/\n> vi test\n> git add *\n\n> date; git commit -a -m \"add minor change\"; date\nMon Nov  3 00:31:02 EST 2008\nCreated commit 9b845a2: add minor change\n 1 files changed, 2 insertions(+), 0 deletions(-)\nMon Nov  3 00:31:10 EST 2008\n\n> date; git commit -a -m \"add test, without network\"; date\nMon Nov  3 00:46:00 EST 2008\nCreated commit dd02a69: add test, without network\n 1 files changed, 3 insertions(+), 0 deletions(-)\nMon Nov  3 00:46:00 EST 2008\n\n> git --version\ngit version 1.5.6.3\n\nAnyone know why is git-commit so slow? Or if there I can anything to change\nthis?\n\nI'd assumed the slowness was normal, since I'm new to version control. I've\ngoogled and searched mailing lists, but haven't found this. Could be just my\ninstallation (or others make the same assumption?)\n\nMany thanks for any help... I'm going a little crazy here.\n\n\n-- \nView this message in context: http://n2.nabble.com/commit-takes-8-secs--but-instant-when-offline---can-I-fix-this--tp1445352p1445352.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"94660","messageId":"200811021514.00057.trast@student.ethz.ch","threadId":"16130","inReplyTo":"1225634894605-1445352.post@n2.nabble.com","subject":"Re: commit takes 8 secs; but instant when offline - can I fix this?","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2008-11-02T14:13:56Z","receivedAt":"2008-11-02T14:13:56Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"13ren wrote:\n> With the network plugged in, git-commit takes 8 seconds.\n> \n> When I unplug the network, commit is instant...\n\nConfigure your user.email (and user.name), see man git-config.  If the\nemail is not set, Git tries to figure out your hostname, which\ndepending on DNS misconfigurations can apparently cause such delays.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n\n"},{"id":"94670","messageId":"7d856ea50811020834n3a252ae2r21d36b24c10eebbf@mail.gmail.com","threadId":"16130","inReplyTo":"200811021514.00057.trast@student.ethz.ch","subject":"Re: commit takes 8 secs; but instant when offline - can I fix this?","fromName":"Brendan Macmillan","fromEmail":"melbourne.research@gmail.com","sentAt":"2008-11-02T16:34:48Z","receivedAt":"2008-11-02T16:34:48Z","isPatch":false,"sender":{"key":"melbourne.research@gmail.com","avatar":null},"body":"Many thanks for the explanation, and it's now instant.\n\nTo ~/.gitconfig, I added:\n\n[user]\n  email = myemail@address.com\n\n\nOn 03/11/2008, Thomas Rast <trast@student.ethz.ch> wrote:\n> 13ren wrote:\n>  > With the network plugged in, git-commit takes 8 seconds.\n>  >\n>  > When I unplug the network, commit is instant...\n>\n> Configure your user.email (and user.name), see man git-config.  If the\n>  email is not set, Git tries to figure out your hostname, which\n>  depending on DNS misconfigurations can apparently cause such delays.\n"},{"id":"94685","messageId":"alpine.LFD.2.00.0811021115030.3483@nehalem.linux-foundation.org","threadId":"16130","inReplyTo":"7d856ea50811020834n3a252ae2r21d36b24c10eebbf@mail.gmail.com","subject":"Re: commit takes 8 secs; but instant when offline - can I fix this?","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2008-11-02T19:18:34Z","receivedAt":"2008-11-02T19:18:34Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Mon, 3 Nov 2008, Brendan Macmillan wrote:\n>\n> Many thanks for the explanation, and it's now instant.\n> \n> To ~/.gitconfig, I added:\n> \n> [user]\n>   email = myemail@address.com\n\nI'd like to point out that in addition to making git not try to figure out \nyour hostname, you may well want to try to fix your setup so that it \ndoesn't take that long in the first place. \n\nIn fact, you might use \"git commit\" (or \"git var -l\" which probably shows \nthe same 8-second thing more easily without needing anything else) as a \nway to debug what it is that takes too long.\n\nBecause even though adding your email to yout .gitconfig file is the right \nsolution _anyway_ (because the git guess is rather more flaky than you \njust telling it what host to use), I bet there are other programs that \nwill have the same 8-second delay, and you are better off trying to just \nfix your DNS problem.\n\n\t\t\tLinus\n"}]}