git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Larry D'Anna <larry@elder-gods.org>
Cc: git@vger.kernel.org
Subject: Re: I'd like to be able to know what git-push will do
Date: Mon, 22 Jun 2009 17:40:32 -0400	[thread overview]
Message-ID: <20090622214032.GC19364@coredump.intra.peff.net> (raw)
In-Reply-To: <20090618212803.GA14486@cthulhu>

On Thu, Jun 18, 2009 at 05:28:03PM -0400, Larry D'Anna wrote:

> I'd like to be able to call git-push --dry-run and process the result
> from a perl script, but there's a snag: what does "foobar -> foobar"
> mean?  foobar could be a tag or a branch.  In fact, it could be a
> branch on on side and a tag on the other!

Yeah, that output is really meant for human consumption.

> I've tried duplicating the refspec processing in the perl script, but
> this approach is highly sub-optimal because the refspec parsing and
> matching is so complicated.  I would wind up duplicating a lot of
> functionality, and every time it changed in git my script would become
> broken.

Agreed.

> Would you accept a patch that changes the behavior of git-push so that
> instead of
> 
>   $ git-push --dry-run  -v origin :
>   Pushing to ~/repos/bin
>   To ~/repos/bin
>    = [up to date]      master -> master
>   Everything up-to-date
>   
> It would print the full names like this (only if -v is used)
> 
>   $ git-push --dry-run  -v origin :
>   Pushing to ~/repos/bin
>   To ~/repos/bin
>    = [up to date]      refs/heads/master -> refs/heads/master
>   Everything up-to-date
> 
> Or, if you don't like changing the behavior of -v, would you accept a
> patch with a new option (perhaps --symbolic-full-name) that caused
> git-push to behave this way?

I think it would have to be a new option, as "-v" is really about
something orthogonal. However, I actually think you are better off
making a whole new output format for porcelain scripts to read. As I
said, the current output is for human consumption, and I wouldn't rule
out the possibility of it changing in the future (and it won't receive
the same sort of deprecation treatment that an interface created for
scripts would get).

In other words, something like:

  $ git push --dry-run --porcelain origin :
  =refs/heads/master:refs/heads/master

(the format is totally off the top of my head -- I haven't thought too
long about what you might want to have in it).

-Peff

  reply	other threads:[~2009-06-22 21:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-18 21:28 I'd like to be able to know what git-push will do Larry D'Anna
2009-06-22 21:40 ` Jeff King [this message]
2009-06-23  1:10   ` [PATCH] add --porcelain option to git-push Larry D'Anna
2009-06-23 15:07     ` Marc Branchaud
2009-06-23 15:38       ` [PATCH] add --plumbing " Larry D'Anna
2009-06-23 15:50       ` [PATCH] add --porcelain " Junio C Hamano
2009-06-23 17:09         ` Marc Branchaud
2009-06-23 18:41       ` Markus Heidelberg
2009-06-23 22:38     ` Constantine Plotnikov
2009-06-24  0:26       ` Larry D'Anna
2009-06-25 19:07     ` Junio C Hamano
2009-06-25 19:30       ` Larry D'Anna
2009-06-27  0:23       ` [PATCH] add --summary " Larry D'Anna

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20090622214032.GC19364@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=larry@elder-gods.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).