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

[SCRIPT] git-upstream: prints the tracking chain starting at the named ref

From
SCScott Collins <scc@slashdot.org>
Date
Jul 26, 2008, 14:44 UTC
Message-ID
<26F09105-BFA2-4FA2-86AA-B9E6F9DE3762@slashdot.org>
Howdy, all.
Here's a script I've sort of `grown' over the past few weeks.

I use it to quickly see where a tracking branch stands with respect to upstream refs _without_ actually fetching or even switching to the tracking branch. This may not be useful for everyones' work-flows; but I find it handy. I'm posting because it may be of use to others (and feedback, if any, can only improve it).

Example:
	$ git upstream -v --abbrev master
	ce567d1... master* is behind 'origin/master' by 17 commits, and can  
be fast-forwarded.
	186458b... origin/master
	186458b... master@origin, git://git.kernel.org/pub/scm/git/git.git
For more info, try: git upstream -v -h

It's a perl script and uses Git.pm. Tries to fit into git standard practices. Supports colors (defaults to color like git branch), configs. It has a few rough edges, but it's very usable. The tiny pause before printing a remote tracking branch is ls-remote. I hope the name doesn't conflict with anything.

I apologize for attaching rather than inserting in-line; but this is a complete file, not a patch and I also don't trust my mailer :-(

hopefully someone else finds this useful :-) _____________ Scott Collins

Next: Petr Baudis
Message 1 of 2 in “[SCRIPT] git-upstream: prints the tracking chain starting at the named ref”
  1. Scott CollinsJul 26, 2008
  2. Petr BaudisJul 26, 2008

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.