* why no "git fetch --dry-run" ?
@ 2008-11-21 21:41 Leo Razoumov
2008-11-21 22:18 ` Miklos Vajna
2008-11-22 0:40 ` Junio C Hamano
0 siblings, 2 replies; 4+ messages in thread
From: Leo Razoumov @ 2008-11-21 21:41 UTC (permalink / raw)
To: Git Mailing List
Hello List,
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.
For example, I just want to see which branches, if any, changed on a
remote repository since my last fetch. "git fetch -v --dry-run" would
be handy in this case.
--Leo--
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: why no "git fetch --dry-run" ?
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
1 sibling, 1 reply; 4+ messages in thread
From: Miklos Vajna @ 2008-11-21 22:18 UTC (permalink / raw)
To: Leo Razoumov; +Cc: Git Mailing List
[-- Attachment #1: Type: text/plain, Size: 653 bytes --]
On Fri, Nov 21, 2008 at 04:41:57PM -0500, Leo Razoumov <slonik.az@gmail.com> wrote:
> 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.
> For example, I just want to see which branches, if any, changed on a
> remote repository since my last fetch. "git fetch -v --dry-run" would
> be handy in this case.
Actually fetch - at a core level - isn't symmetric to push, the protocol
is completely different. I haven't checked the source, but I suppose
that the push protocol has "dry run" support, while the fetch one
doesn't have.
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: why no "git fetch --dry-run" ?
2008-11-21 22:18 ` Miklos Vajna
@ 2008-11-21 23:14 ` Baz
0 siblings, 0 replies; 4+ messages in thread
From: Baz @ 2008-11-21 23:14 UTC (permalink / raw)
To: Miklos Vajna; +Cc: Leo Razoumov, Git Mailing List
2008/11/21 Miklos Vajna <vmiklos@frugalware.org>:
> On Fri, Nov 21, 2008 at 04:41:57PM -0500, Leo Razoumov <slonik.az@gmail.com> wrote:
>> 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.
>> For example, I just want to see which branches, if any, changed on a
>> remote repository since my last fetch. "git fetch -v --dry-run" would
>> be handy in this case.
>
> Actually fetch - at a core level - isn't symmetric to push, the protocol
> is completely different. I haven't checked the source, but I suppose
> that the push protocol has "dry run" support, while the fetch one
> doesn't have.
>
I wrote the patch for "push --dry-run" because I was more worried
about messing up the central repository (which I can't fix) than
messing up my local repository (which I can). It just needed a few
checks added to send-pack to make it work. I guess it's not been done
for fetch yet because nobody had that itch, shouldn't be too hard to
write. Certainly, other people have asked for it.
-Baz
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: why no "git fetch --dry-run" ?
2008-11-21 21:41 why no "git fetch --dry-run" ? Leo Razoumov
2008-11-21 22:18 ` Miklos Vajna
@ 2008-11-22 0:40 ` Junio C Hamano
1 sibling, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2008-11-22 0:40 UTC (permalink / raw)
To: SLONIK.AZ; +Cc: Git Mailing List
"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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-11-22 0:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).