* How to figure out what 'git push' would do?
@ 2007-08-05 11:37 Steffen Prohaska
2007-08-05 11:42 ` David Kastrup
2007-08-05 17:33 ` Alex Riesen
0 siblings, 2 replies; 6+ messages in thread
From: Steffen Prohaska @ 2007-08-05 11:37 UTC (permalink / raw)
To: Git Mailing List
How can I check what a 'git push' would do, without
actually doing it?
Is there something like 'git push --dry-run', similar
to 'rsync --dry-run'?
Steffen
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to figure out what 'git push' would do?
2007-08-05 11:37 How to figure out what 'git push' would do? Steffen Prohaska
@ 2007-08-05 11:42 ` David Kastrup
2007-08-05 17:33 ` Alex Riesen
1 sibling, 0 replies; 6+ messages in thread
From: David Kastrup @ 2007-08-05 11:42 UTC (permalink / raw)
To: Steffen Prohaska; +Cc: Git Mailing List
Steffen Prohaska <prohaska@zib.de> writes:
> How can I check what a 'git push' would do, without
> actually doing it?
>
> Is there something like 'git push --dry-run', similar
> to 'rsync --dry-run'?
Wel, you could put
#!/bin/sh
cat >/tmp/dryrun
exit 1
into
$GIT_DIR/hooks/pre-receive
on the receiving side. Or maybe the update hook.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to figure out what 'git push' would do?
2007-08-05 11:37 How to figure out what 'git push' would do? Steffen Prohaska
2007-08-05 11:42 ` David Kastrup
@ 2007-08-05 17:33 ` Alex Riesen
2007-08-05 17:45 ` Julian Phillips
2007-08-05 19:56 ` Steffen Prohaska
1 sibling, 2 replies; 6+ messages in thread
From: Alex Riesen @ 2007-08-05 17:33 UTC (permalink / raw)
To: Steffen Prohaska; +Cc: Git Mailing List
Steffen Prohaska, Sun, Aug 05, 2007 13:37:34 +0200:
> How can I check what a 'git push' would do, without
> actually doing it?
>
> Is there something like 'git push --dry-run', similar
> to 'rsync --dry-run'?
No. It is often safe to just do git-push, unless you have naive
developers doing pull every time some ref in your shared repo changes
*and* expecting the result to compile (typical for CVS way of work).
git-push will not overwrite anything, it always only forwards history.
For the case you really want to know what the changes on remote repo
will be it is possible to fetch them into the local repo first and
compare with what you will push:
$ git fetch git://remote/path/REPO master:refs/remotes/REPO/master
$ gitk local..REPO/master
It gives you all possible information, which may be worth that bit of
work. Or, if you have all the remote configuration ready, it can be
just:
$ git fetch
$ gitk local..REPO/master
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to figure out what 'git push' would do?
2007-08-05 17:33 ` Alex Riesen
@ 2007-08-05 17:45 ` Julian Phillips
2007-08-05 19:56 ` Steffen Prohaska
1 sibling, 0 replies; 6+ messages in thread
From: Julian Phillips @ 2007-08-05 17:45 UTC (permalink / raw)
To: Alex Riesen; +Cc: Steffen Prohaska, Git Mailing List
On Sun, 5 Aug 2007, Alex Riesen wrote:
> Steffen Prohaska, Sun, Aug 05, 2007 13:37:34 +0200:
>> How can I check what a 'git push' would do, without
>> actually doing it?
>>
>> Is there something like 'git push --dry-run', similar
>> to 'rsync --dry-run'?
>
> No. It is often safe to just do git-push, unless you have naive
> developers doing pull every time some ref in your shared repo changes
> *and* expecting the result to compile (typical for CVS way of work).
> git-push will not overwrite anything, it always only forwards history.
Not strictly true. You _can_ push out non fastforward changes, unless you
have receive.denyNonFastforwards in the repote repo - so you may well be
able to push out something that is completely unrelated to the last commit
the ref pointed to.
--
Julian
---
You never get a second chance to make a first impression.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to figure out what 'git push' would do?
2007-08-05 17:33 ` Alex Riesen
2007-08-05 17:45 ` Julian Phillips
@ 2007-08-05 19:56 ` Steffen Prohaska
2007-08-05 22:09 ` Alex Riesen
1 sibling, 1 reply; 6+ messages in thread
From: Steffen Prohaska @ 2007-08-05 19:56 UTC (permalink / raw)
To: Alex Riesen; +Cc: Git Mailing List
On Aug 5, 2007, at 7:33 PM, Alex Riesen wrote:
> Steffen Prohaska, Sun, Aug 05, 2007 13:37:34 +0200:
>> How can I check what a 'git push' would do, without
>> actually doing it?
>>
>> Is there something like 'git push --dry-run', similar
>> to 'rsync --dry-run'?
>
> No. It is often safe to just do git-push, unless you have naive
> developers doing pull every time some ref in your shared repo changes
> *and* expecting the result to compile (typical for CVS way of work).
> git-push will not overwrite anything, it always only forwards history.
>
> For the case you really want to know what the changes on remote repo
> will be it is possible to fetch them into the local repo first and
> compare with what you will push:
>
> $ git fetch git://remote/path/REPO master:refs/remotes/REPO/master
> $ gitk local..REPO/master
>
> It gives you all possible information, which may be worth that bit of
> work. Or, if you have all the remote configuration ready, it can be
> just:
>
> $ git fetch
> $ gitk local..REPO/master
>
That applies only for a single branch. If I prepared a couple of
branches for pushing and somehow want to double check what I prepared,
'git push --dry-run' would be quite handy. I know how to handle the
situation and could write a custom script that does all necessary
checks. But I haven't found an out-of-the-box solution for double
checking right before 'git push'
Steffen
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: How to figure out what 'git push' would do?
2007-08-05 19:56 ` Steffen Prohaska
@ 2007-08-05 22:09 ` Alex Riesen
0 siblings, 0 replies; 6+ messages in thread
From: Alex Riesen @ 2007-08-05 22:09 UTC (permalink / raw)
To: Steffen Prohaska; +Cc: Git Mailing List
Steffen Prohaska, Sun, Aug 05, 2007 21:56:37 +0200:
> >
> > $ git fetch
> > $ gitk local..REPO/master
> >
>
> That applies only for a single branch. If I prepared a couple of
> branches for pushing and somehow want to double check what I prepared,
> 'git push --dry-run' would be quite handy. I know how to handle the
> situation and could write a custom script that does all necessary
> checks. But I haven't found an out-of-the-box solution for double
> checking right before 'git push'
Well, you can do gitk local1..REPO/remote1 local2..REPO/remote2,
of course, but yes, there is not out-of-the-box solution.
And a straight-forward implementation of "git-push --dry-run" doesn't
look simple... The remote sides git-receive-pack still have to be
called for any useful information, like the references updated and the
SHA-1s they get. IOW, if you can update your system easily to support
--dry-run, it still does not mean the server admin will do that just
as readily. And AFAICS, receive-pack dies if given a parameter it
does not know (it dies on every command line argument which begins
with "-", as it looks). Maybe we should change that first for a very
slow start...
It is simplier to modify git-ls-remote of git-remote to just compare
reference on local and remote side.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-08-05 22:09 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-05 11:37 How to figure out what 'git push' would do? Steffen Prohaska
2007-08-05 11:42 ` David Kastrup
2007-08-05 17:33 ` Alex Riesen
2007-08-05 17:45 ` Julian Phillips
2007-08-05 19:56 ` Steffen Prohaska
2007-08-05 22:09 ` Alex Riesen
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).