Re: fetch <repo> <branch>:<branch> fetches tags?
- From
Brandon Casey <casey@nrlssc.navy.mil>
- Date
- Jan 29, 2008, 03:09 UTC
- Message-ID
- <479E9903.9000706@nrlssc.navy.mil>
- In-Reply-To
- <alpine.LSU.1.00.0801290240240.23907@racer.site>
Johannes Schindelin wrote:
Show 9 quoted lines
> Hi, > > On Mon, 28 Jan 2008, Brandon Casey wrote: > >> Is this the intended behavior? > > AFAICT yes. Whenever you say "git fetch" without "--no-tags", it should > fetch those tags that reference objects that were fetched, and _only_ > those.
It doesn't always fetch tags only when "--no-tags" is missing. Sometimes it refrains from fetching tags even when "--no-tags" is missing.
$ mkdir test1 && cd test1 && git init && echo : > file1 && git add file1 && git commit -m 'Commit1' file1 && git tag -m 'CommitTag1' tag1 && cd .. && mkdir test2 && cd test2 && git init && git fetch ../test1 master && git branch master FETCH_HEAD && cd ../test1 && echo -n 'Test1: ' && git tag -n -l && cd ../test2 && echo -n 'Test2: ' && git tag -n -l | grep '' || echo 'NO TAGS'
Initialized empty Git repository in .git/ Created initial commit 0f701fc: Commit1 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 file1 Initialized empty Git repository in .git/ warning: no common commits remote: Counting objects: 3, done. remote: Total 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. Test1: tag1 CommitTag1 Test2: NO TAGS
Notice the last two lines.
But, change that fetch to master:master and...
$ mkdir test1 && cd test1 && git init && echo : > file1 && git add file1 && git commit -m 'Commit1' file1 && git tag -m 'CommitTag1' tag1 && cd .. && mkdir test2 && cd test2 && git init && git fetch ../test1 master:master && cd ../test1 && echo -n 'Test1: ' && git tag -n -l && cd ../test2 && echo -n 'Test2: ' && git tag -n -l | grep '' || echo 'NO TAGS'
Initialized empty Git repository in .git/ Created initial commit d67022e: Commit1 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 file1 Initialized empty Git repository in .git/ warning: no common commits remote: Counting objects: 3, done. remote: Total 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. From ../test1 * [new branch] master -> master remote: Counting objects: 1, done. remote: Total 1 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (1/1), done. From ../test1 * [new tag] tag1 -> tag1 Test1: tag1 CommitTag1 Test2: tag1 CommitTag1
I only get the tags if I use the colon notation.
-brandon
Show 5 quoted lines
> > Hth, > Dscho > > P.S.: What does the Navy do with git?
Manage software of course! What a silly question.
Kidding aside. I work with oceanographers.