git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to figure out what 'git push' would do?

From
Alex Riesen <raa.lkml@gmail.com>
Date
Aug 5, 2007, 22:09 UTC
Message-ID
<20070805220902.GB3159@steel.home>
In-Reply-To
<515E28B6-85AF-4379-870A-CFECF19B74DE@zib.de>
Steffen Prohaska, Sun, Aug 05, 2007 21:56:37 +0200:
Show 11 quoted lines
> >
> >    $ 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.

Previous: Steffen Prohaska
Message 6 of 6 in “How to figure out what 'git push' would do?”
  1. Steffen ProhaskaAug 5, 2007
  2. David KastrupAug 5, 2007
  3. Alex RiesenAug 5, 2007
  4. Julian PhillipsAug 5, 2007
  5. Steffen ProhaskaAug 5, 2007
  6. Alex RiesenAug 5, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.