Commit graph

19 commits

Author SHA1 Message Date
Junio C Hamano ae2b0f1518 git-sh-setup: die if outside git repository.
Now all the users of this script detect its exit status and die,
complaining that it is outside git repository.  So move the code
that dies from all callers to git-sh-setup script.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-25 13:49:17 -08:00
Linus Torvalds 583122cd1b Make "git fetch" less verbose by default
When doing something like

	git fetch --tags origin

the excessively verbose output of git fetch makes the result totally
unreadable. It's impossible to tell if it actually fetched anything new or
not, since the screen will fill up with an endless supply of

   ...
   * committish: 9165ec17fd
     tag 'v0.99.7c' of master.kernel.org:/pub/scm/git/git
   * refs/tags/v0.99.7c: same as tag 'v0.99.7c' of master.kernel.org:/pub/scm/git/git
   ...

and any new tags that got fetched will be totally hidden.

So add a new "--verbose" flag to "git fetch" to enable this verbose mode,
but make the default be quiet.

NOTE! The quiet mode will still report about new or changed heads, so if
you are really fetching a new head, you'll see something like this:

   [torvalds@g5 git]$ git fetch --tags parent
   Packing 6 objects
   Unpacking 6 objects
    100% (6/6) done
   * refs/tags/v1.0rc2: storing tag 'v1.0rc2' of master.kernel.org:/pub/scm/git/git
   * refs/tags/v1.0rc3: storing tag 'v1.0rc3' of master.kernel.org:/pub/scm/git/git
   * refs/tags/v1.0rc1: storing tag 'v1.0rc1' of master.kernel.org:/pub/scm/git/git

which actually tells you something useful that isn't hidden by all the
useless crud that you already had.

Extensively tested (hey, for me, this _is_ extensive) by doing a

   rm .git/refs/tags/v1.0rc*

and re-fetching with both --verbose and without.

NOTE! This means that if the fetch didn't actually fetch anything at all,
git fetch will be totally quiet. I think that's much better than being so
verbose that you can't even tell whether something was fetched or not, but
some people might prefer to get a "nothing to fetch" message in that case.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-18 11:21:22 -08:00
Josef Weidendorfer 66c9ec2555 Let git-clone/git-fetch follow HTTP redirections
Otherwise, git-clone silently failed to clone a remote
repository where redirections (ie. a response with a
"Location" header line) are used.

This includes the fixes from Nick Hengeveld.

Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-10 15:57:56 -08:00
Junio C Hamano f8765797a4 Even when overwriting tags, report if they are changed or not.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-18 18:42:14 -07:00
Junio C Hamano cdb3950801 Forward port the "funny ref avoidance" in clone and fetch from maint branch.
Somehow I forgot to forward port these fixes.  "git clone" from a
repository prepared with the latest update-server-info would fail
without this patch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-17 21:47:06 -07:00
Junio C Hamano f6b42a81fd Show peeled onion from upload-pack and server-info.
This updates git-ls-remote to show SHA1 names of objects that are
referred by tags, in the "ref^{}" notation.

This would make git-findtags (without -t flag) almost trivial.

    git-peek-remote . |
    sed -ne "s:^$target	"'refs/tags/\(.*\)^{}$:\1:p'

Also Pasky could do:

    git-ls-remote --tags $remote |
    sed -ne 's:\(	refs/tags/.*\)^{}$:\1:p'

to find out what object each of the remote tags refers to, and
if he has one locally, run "git-fetch $remote tag $tagname" to
automatically catch up with the upstream tags.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-15 11:23:41 -07:00
Junio C Hamano 221e743c03 git-fetch --tags: deal with tags with spaces in them.
"git-fetch --tags" can get confused with tags with spaces in their names,
it used to use shell IFS to split the list of tags and also used curl
which insists the URL to be escaped.  Fix it so it can work with Martin's
moodle repository http://locke.catalyst.net.nz/git/moodle.git/.

We still reserve characters like leading plus-sign '+' and colon
':' anywhere to represent refspec src-dst pair, and obviously we
cannot use LF (that terminates Pull: line in .git/remotes
files), but now you can have spaces with this patch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-11 22:05:09 -07:00
Santi_Béjar df34297af1 [PATCH] Quote the missing GIT_DIR.
Signed-off-by: Santi Béjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-05 11:23:23 -07:00
Linus Torvalds ed1aadf1b0 [PATCH] git fetch --tags
You can do

	git fetch --tags <linus-kernel-repo>

and it should fetch all my tags automatically.

[jc: The original by Linus fetched and overwrote branch heads with
 --all, which felt dangerous and wrong, so I removed it.  Also this
 version does not use any refs that resulted as --tags for later
 merge. ]

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-01 23:18:38 -07:00
Junio C Hamano bf7960eb51 Use git-update-ref in scripts.
This uses the git-update-ref command in scripts for safer updates.
Also places where we used to read HEAD ref by using "cat" were fixed
to use git-rev-parse.  This will matter when we start using symbolic
references.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-28 16:42:44 -07:00
Junio C Hamano 05dd8e2ee2 Fix default pull not to do an unintended Octopus.
The refspecs specified in the .git/remotes/<remote> on the "Pull: "
lines are for fetching multiple heads in one go, but most of the time
making an Octopus out of them is not what is wanted.  Make git-fetch
leave the marker in .git/FETCH_HEAD file so that later stages can
tell which heads are for merging and which are not.

Tom Prince made me realize how stupid the original behaviour was.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-28 16:22:00 -07:00
Junio C Hamano 0b7a9fc971 git-fetch: send informational output to >&2 consistently.
Only the "Fetching ... using http" was leaking to stdout.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-26 18:04:17 -07:00
Junio C Hamano b91fb518cc Revert "Make Octopus merge message a bit nicer."
This reverts 63f1aa6c72 commit.
2005-09-21 13:59:54 -07:00
Junio C Hamano 63f1aa6c72 Make Octopus merge message a bit nicer.
Linus says that 'of .' to mean the commits came from the local repository
was too confusing and ugly -- I tend to agree with him.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-20 18:16:27 -07:00
Junio C Hamano 89d844d084 Do not give alarming error message from rsync in fetch and clone.
When we check the optional objects/info/alternates file at the remote
repository, we forgot to really squelch error message from rsync.

Not having that file is not a crime.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-20 15:07:54 -07:00
Junio C Hamano 4447badcd2 Teach rsync transport about alternates.
For local operations and downloading and uploading via git aware protocols,
use of $GIT_OBJECT_DIRECTORY/info/alternates is recommended on the server
side for big projects that are derived from another one (like Linux kernel).

However, dumb protocols and rsync transport needs to resolve this on the
client end, which we did not bother doing until this week.

I noticed we use "rsync -z" but most of our payload is already compressed,
which was not quite right.  This commit also fixes it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-17 11:56:41 -07:00
Junio C Hamano 22c67ca88e Propagate errors from fetch-pack correctly to git-fetch.
When git-fetch-pack fails, the command does not notice the failure
and instead pretended nothing was fetched and there was nothing wrong.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-12 22:52:52 -07:00
Junio C Hamano 866ff2f7ce Make sure we have leading directories under refs/{heads,tags}
Otherwise having subdirectories under refs/heads becomes rather
unwieldy.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-10 10:40:47 -07:00
Junio C Hamano 215a7ad1ef Big tool rename.
As promised, this is the "big tool rename" patch.  The primary differences
since 0.99.6 are:

  (1) git-*-script are no more.  The commands installed do not
      have any such suffix so users do not have to remember if
      something is implemented as a shell script or not.

  (2) Many command names with 'cache' in them are renamed with
      'index' if that is what they mean.

There are backward compatibility symblic links so that you and
Porcelains can keep using the old names, but the backward
compatibility support  is expected to be removed in the near
future.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-07 17:45:20 -07:00
Renamed from git-fetch-script (Browse further)