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

Re: [PATCH v2] ls-remote: print URL when no repo is specified

From
GBGeert Bosch <bosch@adacore.com>
Date
May 16, 2010, 17:27 UTC
Message-ID
<47A48A85-CAFC-4B8B-9D24-869A6ABC8EF1@adacore.com>
In-Reply-To
<AANLkTikKZAinLGeRMnqUPsTbBjMiAQuOCXxr4VEPBhHW@mail.gmail.com>
On May 16, 2010, at 06:36, Sverre Rabbelier wrote:
Show 9 quoted lines
> On Sun, May 16, 2010 at 04:14, Geert Bosch <bosch@adacore.com> wrote:
>> What git seems to be missing is a "git info" command, which
>> would print out essentially something like what "svn info" does:
>> name of remote repo that we're tracking, name of current branch,
>> date/author/subject of last commit.
> 
> You can get information about the remote with:
> 
> $ git remote -v
geert-boschs-computer:/tmp%ssh kwai git init --bare /work/bosch/temp.git
Initialized empty Git repository in /export/work/bosch/temp.git/
geert-boschs-computer:/tmp%git init temp
Initialized empty Git repository in /private/tmp/temp/.git/
geert-boschs-computer:/tmp%cd temp
geert-boschs-computer:/tmp/temp%echo hello>world
geert-boschs-computer:/tmp/temp%git add world
geert-boschs-computer:/tmp/temp%git commit -m "Add hello" world
[master (root-commit) 10837b9] Add hello
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 world
geert-boschs-computer:/tmp/temp%git push --all kwai:/work/bosch/temp.git
Counting objects: 3, done.
Writing objects: 100% (3/3), 211 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To kwai:/work/bosch/temp.git
 * [new branch]      master -> master
geert-boschs-computer:/tmp/temp%git push -u --all kwai:/work/bosch/temp.git
Branch master set up to track remote branch master from kwai:/work/bosch/temp.git.
Everything up-to-date
geert-boschs-computer:/tmp/temp%git remote -v
geert-boschs-computer:/tmp/temp%git push
Everything up-to-date

So, there is a remote that gets used automatically by git push and git pull, but it's not obvious which one. Basically, a "git info" command should give a dozen lines or so that allows one quickly to identify a repository, including current branch, any remote it tracks, last commit, wether the working directory is clean, wether anything is staged for commit, wether the repository tracks a non-git (svn, bzr, hg) repository.

> 
> And then for the branch etc you can do (although it doesn't list the author):
> 
> $ git branch -v

While both commands are very useful, I think a case can be made for a single command that pulls together enough information in a few lines that it is clear.

I'll see if I can cobble something up.
Previous: Sverre Rabbelier
Message 12 of 12 in “ls-remote: print URL when no repo is specified”
  1. ls-remote: print URL when no repo is specifiedTay Ray Chuan, May 9, 2010
  2. Jonathan NiederMay 9, 2010
  3. ls-remote: print URL when no repo is specifiedTay Ray Chuan, May 11, 2010
  4. Junio C HamanoMay 12, 2010
  5. Tay Ray ChuanMay 14, 2010
  6. Jonathan NiederMay 14, 2010
  7. Tay Ray ChuanMay 15, 2010
  8. Jonathan NiederMay 15, 2010
  9. Junio C HamanoMay 20, 2010
  10. Geert BoschMay 16, 2010
  11. Sverre RabbelierMay 16, 2010
  12. Geert BoschMay 16, 2010

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.