git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: SLONIK.AZ@gmail.com
Cc: "Git Mailing List" <git@vger.kernel.org>
Subject: Re: why no "git fetch --dry-run" ?
Date: Fri, 21 Nov 2008 16:40:13 -0800	[thread overview]
Message-ID: <7vtza0pp8y.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <ee2a733e0811211341j1e49fad7o64577605951fa5c0@mail.gmail.com> (Leo Razoumov's message of "Fri, 21 Nov 2008 16:41:57 -0500")

"Leo Razoumov" <slonik.az@gmail.com> writes:

> I am curious why there is "git push --dry-run" and no "git fetch
> --dry-run" nor "git pull --dry-run". It would make sense to keep
> push/pull/fetch as symmetric as possible.

There are things that are not implemented in git because they do not make
sense, and there are things that are not implemented in git because nobody
had itch to scratch for.  To put it differently, we tend to implement only
things that there are actual, demonstrated needs for from real world and
only when the addition makes sense as a coherent part of the system.

"fetch --dry-run" falls into the latter category.

"push" is hard to undo because it affects the outside world, but "fetch"
is only about your local object store and its remote tracking branches, so
the need to have --dry-run mode to "push" was much more real than to the
need for "fetch --dry-run" and was implemented.

If you have the itch for the latter, I do not think anybody objects to it
on the ground that such a feature does not make sense.

Having said that, "fetch --dry-run" probably has little value in practice.
You cannot tell how much data will be transferred before actually running
a fetch, so it won't be a tool for you to decide if you can afford the
time to run fetch now or do that later ("push --dry-run" will let you gain
the necessary information for doing this this if your push is
fast-forward, which should mostly be the case).  The only information you
would get is if an actual "fetch" will have any update to each of the
branches you are tracking (so that's one bit per branch) and if you have a
connection to the other end, and that is about it.

      parent reply	other threads:[~2008-11-22  0:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-21 21:41 why no "git fetch --dry-run" ? Leo Razoumov
2008-11-21 22:18 ` Miklos Vajna
2008-11-21 23:14   ` Baz
2008-11-22  0:40 ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vtza0pp8y.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=SLONIK.AZ@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).