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

I'd like to be able to know what git-push will do

From
Larry D'Anna <larry@elder-gods.org>
Date
Jun 18, 2009, 21:28 UTC
Message-ID
<20090618212803.GA14486@cthulhu>

I previously sent this to Junio, but I think I should have just sent it to the list.

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!

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.

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?

Once I know what the user interface should be (-v or --symbolic-full-name or whatever) I'll post a patch.

Thanks!
        --larry
Next: Jeff King
Message 1 of 13 in “I'd like to be able to know what git-push will do”
  1. Larry D'AnnaJun 18, 2009
  2. Jeff KingJun 22, 2009
  3. add --porcelain option to git-pushLarry D'Anna, Jun 23, 2009
  4. Marc BranchaudJun 23, 2009
  5. add --plumbing option to git-pushLarry D'Anna, Jun 23, 2009
  6. Junio C HamanoJun 23, 2009
  7. Marc BranchaudJun 23, 2009
  8. Markus HeidelbergJun 23, 2009
  9. Constantine PlotnikovJun 23, 2009
  10. Larry D'AnnaJun 24, 2009
  11. Junio C HamanoJun 25, 2009
  12. Larry D'AnnaJun 25, 2009
  13. add --summary option to git-pushLarry D'Anna, Jun 27, 2009

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.