{"thread":{"id":"16427","subject":"why no \"git fetch --dry-run\" ?","startedAt":"2008-11-21T21:41:57Z","lastAt":"2008-11-22T00:40:13Z","messageCount":4,"participants":["Leo Razoumov","Miklos Vajna","Baz","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"96354","messageId":"ee2a733e0811211341j1e49fad7o64577605951fa5c0@mail.gmail.com","threadId":"16427","inReplyTo":null,"subject":"why no \"git fetch --dry-run\" ?","fromName":"Leo Razoumov","fromEmail":"slonik.az@gmail.com","sentAt":"2008-11-21T21:41:57Z","receivedAt":"2008-11-21T21:41:57Z","isPatch":false,"sender":{"key":"slonik.az@gmail.com","avatar":null},"body":"Hello List,\nI am curious why there is \"git push --dry-run\" and no \"git fetch\n--dry-run\" nor \"git pull --dry-run\". It would make sense to keep\npush/pull/fetch as symmetric as possible.\nFor example, I just want to see which branches, if any, changed on a\nremote repository since my last fetch. \"git fetch -v --dry-run\" would\nbe handy in this case.\n\n--Leo--\n"},{"id":"96356","messageId":"20081121221826.GM21815@genesis.frugalware.org","threadId":"16427","inReplyTo":"ee2a733e0811211341j1e49fad7o64577605951fa5c0@mail.gmail.com","subject":"Re: why no \"git fetch --dry-run\" ?","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-11-21T22:18:26Z","receivedAt":"2008-11-21T22:18:26Z","isPatch":false,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Fri, Nov 21, 2008 at 04:41:57PM -0500, Leo Razoumov <slonik.az@gmail.com> wrote:\n> I am curious why there is \"git push --dry-run\" and no \"git fetch\n> --dry-run\" nor \"git pull --dry-run\". It would make sense to keep\n> push/pull/fetch as symmetric as possible.\n> For example, I just want to see which branches, if any, changed on a\n> remote repository since my last fetch. \"git fetch -v --dry-run\" would\n> be handy in this case.\n\nActually fetch - at a core level - isn't symmetric to push, the protocol\nis completely different. I haven't checked the source, but I suppose\nthat the push protocol has \"dry run\" support, while the fetch one\ndoesn't have.\n"},{"id":"96358","messageId":"2faad3050811211514u1f3eb3deg7ae597a0328c981c@mail.gmail.com","threadId":"16427","inReplyTo":"20081121221826.GM21815@genesis.frugalware.org","subject":"Re: why no \"git fetch --dry-run\" ?","fromName":"Baz","fromEmail":"brian.ewins@gmail.com","sentAt":"2008-11-21T23:14:59Z","receivedAt":"2008-11-21T23:14:59Z","isPatch":false,"sender":{"key":"brian.ewins@gmail.com","avatar":"https://gravatar.com/avatar/9ac03d89105e50a7151e695a1b4b1228151064ec3ac380a73b74ab397796baf7?d=mp&s=160"},"body":"2008/11/21 Miklos Vajna <vmiklos@frugalware.org>:\n> On Fri, Nov 21, 2008 at 04:41:57PM -0500, Leo Razoumov <slonik.az@gmail.com> wrote:\n>> I am curious why there is \"git push --dry-run\" and no \"git fetch\n>> --dry-run\" nor \"git pull --dry-run\". It would make sense to keep\n>> push/pull/fetch as symmetric as possible.\n>> For example, I just want to see which branches, if any, changed on a\n>> remote repository since my last fetch. \"git fetch -v --dry-run\" would\n>> be handy in this case.\n>\n> Actually fetch - at a core level - isn't symmetric to push, the protocol\n> is completely different. I haven't checked the source, but I suppose\n> that the push protocol has \"dry run\" support, while the fetch one\n> doesn't have.\n>\n\nI wrote the patch for \"push --dry-run\" because I was more worried\nabout messing up the central repository (which I can't fix) than\nmessing up my local repository (which I can). It just needed a few\nchecks added to send-pack to make it work. I guess it's not been done\nfor fetch yet because nobody had that itch, shouldn't be too hard to\nwrite. Certainly, other people have asked for it.\n\n-Baz\n"},{"id":"96359","messageId":"7vtza0pp8y.fsf@gitster.siamese.dyndns.org","threadId":"16427","inReplyTo":"ee2a733e0811211341j1e49fad7o64577605951fa5c0@mail.gmail.com","subject":"Re: why no \"git fetch --dry-run\" ?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-11-22T00:40:13Z","receivedAt":"2008-11-22T00:40:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Leo Razoumov\" <slonik.az@gmail.com> writes:\n\n> I am curious why there is \"git push --dry-run\" and no \"git fetch\n> --dry-run\" nor \"git pull --dry-run\". It would make sense to keep\n> push/pull/fetch as symmetric as possible.\n\nThere are things that are not implemented in git because they do not make\nsense, and there are things that are not implemented in git because nobody\nhad itch to scratch for.  To put it differently, we tend to implement only\nthings that there are actual, demonstrated needs for from real world and\nonly when the addition makes sense as a coherent part of the system.\n\n\"fetch --dry-run\" falls into the latter category.\n\n\"push\" is hard to undo because it affects the outside world, but \"fetch\"\nis only about your local object store and its remote tracking branches, so\nthe need to have --dry-run mode to \"push\" was much more real than to the\nneed for \"fetch --dry-run\" and was implemented.\n\nIf you have the itch for the latter, I do not think anybody objects to it\non the ground that such a feature does not make sense.\n\nHaving said that, \"fetch --dry-run\" probably has little value in practice.\nYou cannot tell how much data will be transferred before actually running\na fetch, so it won't be a tool for you to decide if you can afford the\ntime to run fetch now or do that later (\"push --dry-run\" will let you gain\nthe necessary information for doing this this if your push is\nfast-forward, which should mostly be the case).  The only information you\nwould get is if an actual \"fetch\" will have any update to each of the\nbranches you are tracking (so that's one bit per branch) and if you have a\nconnection to the other end, and that is about it.\n"}]}