Merge branch 'ap/clone-origin' into next

* ap/clone-origin:
  Explicitly add the default "git pull" behaviour to .git/config on clone
  git-merge: fix "fix confusion between tag and branch" for real
  git-svn: avoid network timeouts for long-running fetches
  gitweb: Allow PNG, GIF, JPEG images to be displayed in "blob" view
  git-merge: squelch needless error message.
  git-reset to remove "$GIT_DIR/MERGE_MSG"
  cvs-migration: improved section titles, better push/commit explanation
  cvs-migration document: make the need for "push" more obvious
This commit is contained in:
Junio C Hamano
2006-12-06 11:24:14 -08:00
6 changed files with 48 additions and 19 deletions

View File

@@ -24,6 +24,11 @@ First, note some ways that git differs from CVS:
single shared repository which people can synchronize with; see below
for details.
* Since every working tree contains a repository, a commit in your
private repository will not publish your changes; it will only create
a revision. You have to "push" your changes to a public repository to
make them visible to others.
Importing a CVS archive
-----------------------
@@ -76,8 +81,8 @@ variants of this model.
With a small group, developers may just pull changes from each other's
repositories without the need for a central maintainer.
Emulating the CVS Development Model
-----------------------------------
Creating a Shared Repository
----------------------------
Start with an ordinary git working directory containing the project, and
remove the checked-out files, keeping just the bare .git directory:
@@ -105,7 +110,10 @@ $ GIT_DIR=repo.git git repo-config core.sharedrepository true
Make sure committers have a umask of at most 027, so that the directories
they create are writable and searchable by other group members.
Suppose this repository is now set up in /pub/repo.git on the host
Performing Development on a Shared Repository
---------------------------------------------
Suppose a repository is now set up in /pub/repo.git on the host
foo.com. Then as an individual committer you can clone the shared
repository:
@@ -134,15 +142,17 @@ Pull: master:origin
------------
================================
You can update the shared repository with your changes using:
You can update the shared repository with your changes by first commiting
your changes, and then using:
------------------------------------------------
$ git push origin master
------------------------------------------------
If someone else has updated the repository more recently, `git push`, like
`cvs commit`, will complain, in which case you must pull any changes
before attempting the push again.
to "push" those commits to the shared repository. If someone else has
updated the repository more recently, `git push`, like `cvs commit`, will
complain, in which case you must pull any changes before attempting the
push again.
In the `git push` command above we specify the name of the remote branch
to update (`master`). If we leave that out, `git push` tries to update

View File

@@ -413,7 +413,9 @@ then
rm -f "refs/remotes/$origin/HEAD"
git-symbolic-ref "refs/remotes/$origin/HEAD" \
"refs/remotes/$origin/$head_points_at"
esac
esac &&
git-repo-config branch."$head_points_at".remote "$origin" &&
git-repo-config branch."$head_points_at".merge "refs/heads/$head_points_at"
esac
case "$no_checkout" in

View File

@@ -233,8 +233,9 @@ else
# in this loop.
merge_name=$(for remote
do
rh=$(git-rev-parse --verify "$remote"^0 2>/dev/null) &&
bh=$(git show-ref -s --verify "refs/heads/$remote") &&
rh=$(git-rev-parse --verify "$remote"^0 2>/dev/null) ||
continue ;# not something we can merge
bh=$(git show-ref -s --verify "refs/heads/$remote" 2>/dev/null)
if test "$rh" = "$bh"
then
echo "$rh branch '$remote' of ."

View File

@@ -63,6 +63,7 @@ case "$reset_type" in
;;
esac
rm -f "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/rr-cache/MERGE_RR" "$GIT_DIR/SQUASH_MSG"
rm -f "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/rr-cache/MERGE_RR" \
"$GIT_DIR/SQUASH_MSG" "$GIT_DIR/MERGE_MSG"
exit $update_ref_status

View File

@@ -459,6 +459,7 @@ sub fetch_lib {
$min = $max + 1;
$max += $inc;
$max = $head if ($max > $head);
$SVN = libsvn_connect($SVN_URL);
}
restore_index($index);
return { revision => $last_rev, commit => $last_commit };

View File

@@ -3229,10 +3229,13 @@ sub git_blob {
open my $fd, "-|", git_cmd(), "cat-file", "blob", $hash
or die_error(undef, "Couldn't cat $file_name, $hash");
my $mimetype = blob_mimetype($fd, $file_name);
if ($mimetype !~ m/^text\//) {
if ($mimetype !~ m!^(?:text/|image/(?:gif|png|jpeg)$)!) {
close $fd;
return git_blob_plain($mimetype);
}
# we can have blame only for text/* mimetype
$have_blame &&= ($mimetype =~ m!^text/!);
git_header_html(undef, $expires);
my $formats_nav = '';
if (defined $hash_base && (my %co = parse_commit($hash_base))) {
@@ -3269,13 +3272,24 @@ sub git_blob {
}
git_print_page_path($file_name, "blob", $hash_base);
print "<div class=\"page_body\">\n";
my $nr;
while (my $line = <$fd>) {
chomp $line;
$nr++;
$line = untabify($line);
printf "<div class=\"pre\"><a id=\"l%i\" href=\"#l%i\" class=\"linenr\">%4i</a> %s</div>\n",
$nr, $nr, $nr, esc_html($line, -nbsp=>1);
if ($mimetype =~ m!^text/!) {
my $nr;
while (my $line = <$fd>) {
chomp $line;
$nr++;
$line = untabify($line);
printf "<div class=\"pre\"><a id=\"l%i\" href=\"#l%i\" class=\"linenr\">%4i</a> %s</div>\n",
$nr, $nr, $nr, esc_html($line, -nbsp=>1);
}
} elsif ($mimetype =~ m!^image/!) {
print qq!<img type="$mimetype"!;
if ($file_name) {
print qq! alt="$file_name" title="$file_name"!;
}
print qq! src="! .
href(action=>"blob_plain", hash=>$hash,
hash_base=>$hash_base, file_name=>$file_name) .
qq!" />\n!;
}
close $fd
or print "Reading blob failed.\n";