Skip to content

Commit

Permalink
Merge maint branch for tracking l10n updates of git stable version
Browse files Browse the repository at this point in the history
Use master branch to track l10n updates for git next release, while
use maint branch to track l10n updates for git stable version.
  • Loading branch information
Jiang Xin committed Apr 28, 2012
2 parents 01b127c + 868d662 commit b240ea2
Show file tree
Hide file tree
Showing 40 changed files with 779 additions and 213 deletions.
50 changes: 50 additions & 0 deletions Documentation/RelNotes/1.7.10.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Git v1.7.10.1 Release Notes
===========================

Fixes since v1.7.10
-------------------

* "git add -p" is not designed to deal with unmerged paths but did
not exclude them and tried to apply funny patches only to fail.

* When PATH contains an unreadable directory, alias expansion code
did not kick in, and failed with an error that said "git-subcmd"
was not found.

* "git clean -d -f" (not "-d -f -f") is supposed to protect nested
working trees of independent git repositories that exist in the
current project working tree from getting removed, but the
protection applied only to such working trees that are at the
top-level of the current project by mistake.

* "git commit --author=$name" did not tell the name that was being
recorded in the resulting commit to hooks, even though it does do
so when the end user overrode the authorship via the
"GIT_AUTHOR_NAME" environment variable.

* When "git commit --template F" errors out because the user did not
touch the message, it claimed that it aborts due to "empty
message", which was utterly wrong.

* The regexp configured with diff.wordregex was incorrectly reused
across files.

* An age-old corner case bug in combine diff (only triggered with -U0
and the hunk at the beginning of the file needs to be shown) has
been fixed.

* Rename detection logic used to match two empty files as renames
during merge-recursive, leading to unnatural mismerges.

* Running "notes merge --commit" failed to perform correctly when run
from any directory inside $GIT_DIR/. When "notes merge" stops with
conflicts, $GIT_DIR/NOTES_MERGE_WORKTREE is the place a user edits
to resolve it.

* The 'push to upstream' implementation was broken in some corner
cases. "git push $there" without refspec, when the current branch
is set to push to a remote different from $there, used to push to
$there using the upstream information to a remote unreleated to
$there.

Also contains minor fixes and documentation updates.
13 changes: 13 additions & 0 deletions Documentation/RelNotes/1.7.7.7.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Git v1.7.7.7 Release Notes
==========================

Fixes since v1.7.7.6
--------------------

* An error message from 'git bundle' had an unmatched single quote pair in it.

* 'git diff --histogram' option was not described.

* 'git imap-send' carried an unused dead code.

Also contains minor fixes and documentation updates.
22 changes: 22 additions & 0 deletions Documentation/RelNotes/1.7.8.6.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Git v1.7.8.6 Release Notes
==========================

Fixes since v1.7.8.5
--------------------

* An error message from 'git bundle' had an unmatched single quote pair in it.

* 'git diff --histogram' option was not described.

* Documentation for 'git rev-list' had minor formatting errors.

* 'git imap-send' carried an unused dead code.

* The way 'git fetch' implemented its connectivity check over
received objects was overly pessimistic, and wasted a lot of
cycles.

* Various minor backports of fixes from the 'master' and the 'maint'
branch.

Also contains minor fixes and documentation updates.
13 changes: 13 additions & 0 deletions Documentation/RelNotes/1.7.9.7.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Git v1.7.9.7 Release Notes
==========================

Fixes since v1.7.9.6
--------------------

* An error message from 'git bundle' had an unmatched single quote pair in it.

* The way 'git fetch' implemented its connectivity check over
received objects was overly pessimistic, and wasted a lot of
cycles.

Also contains minor fixes and documentation updates.
13 changes: 8 additions & 5 deletions Documentation/git-commit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,14 @@ OPTIONS

-t <file>::
--template=<file>::
Use the contents of the given file as the initial version
of the commit message. The editor is invoked and you can
make subsequent changes. If a message is specified using
the `-m` or `-F` options, this option has no effect. This
overrides the `commit.template` configuration variable.
When editing the commit message, start the editor with the
contents in the given file. The `commit.template` configuration
variable is often used to give this option implicitly to the
command. This mechanism can be used by projects that want to
guide participants with some hints on what to write in the message
in what order. If the user exits the editor without editing the
message, the commit is aborted. This has no effect when a message
is given by other means, e.g. with the `-m` or `-F` options.

-s::
--signoff::
Expand Down
9 changes: 6 additions & 3 deletions Documentation/git.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ Documentation for older releases are available here:
* release notes for
link:RelNotes/1.7.10.txt[1.7.10].

* link:v1.7.9.6/git.html[documentation for release 1.7.9.6]
* link:v1.7.9.7/git.html[documentation for release 1.7.9.7]

* release notes for
link:RelNotes/1.7.9.7.txt[1.7.9.7],
link:RelNotes/1.7.9.6.txt[1.7.9.6],
link:RelNotes/1.7.9.5.txt[1.7.9.5],
link:RelNotes/1.7.9.4.txt[1.7.9.4],
Expand All @@ -60,19 +61,21 @@ Documentation for older releases are available here:
link:RelNotes/1.7.9.1.txt[1.7.9.1],
link:RelNotes/1.7.9.txt[1.7.9].

* link:v1.7.8.5/git.html[documentation for release 1.7.8.5]
* link:v1.7.8.6/git.html[documentation for release 1.7.8.6]

* release notes for
link:RelNotes/1.7.8.6.txt[1.7.8.6],
link:RelNotes/1.7.8.5.txt[1.7.8.5],
link:RelNotes/1.7.8.4.txt[1.7.8.4],
link:RelNotes/1.7.8.3.txt[1.7.8.3],
link:RelNotes/1.7.8.2.txt[1.7.8.2],
link:RelNotes/1.7.8.1.txt[1.7.8.1],
link:RelNotes/1.7.8.txt[1.7.8].

* link:v1.7.7.6/git.html[documentation for release 1.7.7.6]
* link:v1.7.7.7/git.html[documentation for release 1.7.7.7]

* release notes for
link:RelNotes/1.7.7.7.txt[1.7.7.7],
link:RelNotes/1.7.7.6.txt[1.7.7.6],
link:RelNotes/1.7.7.5.txt[1.7.7.5],
link:RelNotes/1.7.7.4.txt[1.7.7.4],
Expand Down
2 changes: 1 addition & 1 deletion RelNotes
84 changes: 62 additions & 22 deletions builtin/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,20 @@ static int is_a_merge(const struct commit *current_head)

static const char sign_off_header[] = "Signed-off-by: ";

static void export_one(const char *var, const char *s, const char *e, int hack)
{
struct strbuf buf = STRBUF_INIT;
if (hack)
strbuf_addch(&buf, hack);
strbuf_addf(&buf, "%.*s", (int)(e - s), s);
setenv(var, buf.buf, 1);
strbuf_release(&buf);
}

static void determine_author_info(struct strbuf *author_ident)
{
char *name, *email, *date;
struct ident_split author;

name = getenv("GIT_AUTHOR_NAME");
email = getenv("GIT_AUTHOR_EMAIL");
Expand Down Expand Up @@ -585,6 +596,11 @@ static void determine_author_info(struct strbuf *author_ident)
date = force_date;
strbuf_addstr(author_ident, fmt_ident(name, email, date,
IDENT_ERROR_ON_NO_NAME));
if (!split_ident_line(&author, author_ident->buf, author_ident->len)) {
export_one("GIT_AUTHOR_NAME", author.name_begin, author.name_end, 0);
export_one("GIT_AUTHOR_EMAIL", author.mail_begin, author.mail_end, 0);
export_one("GIT_AUTHOR_DATE", author.date_begin, author.tz_end, '@');
}
}

static int ends_rfc2822_footer(struct strbuf *sb)
Expand Down Expand Up @@ -652,6 +668,9 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
int ident_shown = 0;
int clean_message_contents = (cleanup_mode != CLEANUP_NONE);

/* This checks and barfs if author is badly specified */
determine_author_info(author_ident);

if (!no_verify && run_hook(index_file, "pre-commit", NULL))
return 0;

Expand Down Expand Up @@ -771,9 +790,6 @@ static int prepare_to_commit(const char *index_file, const char *prefix,

strbuf_release(&sb);

/* This checks and barfs if author is badly specified */
determine_author_info(author_ident);

/* This checks if committer ident is explicitly given */
strbuf_addstr(&committer_ident, git_committer_info(0));
if (use_editor && include_status) {
Expand Down Expand Up @@ -905,27 +921,10 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
return 1;
}

/*
* Find out if the message in the strbuf contains only whitespace and
* Signed-off-by lines.
*/
static int message_is_empty(struct strbuf *sb)
static int rest_is_empty(struct strbuf *sb, int start)
{
struct strbuf tmpl = STRBUF_INIT;
int i, eol;
const char *nl;
int eol, i, start = 0;

if (cleanup_mode == CLEANUP_NONE && sb->len)
return 0;

/* See if the template is just a prefix of the message. */
if (template_file && strbuf_read_file(&tmpl, template_file, 0) > 0) {
stripspace(&tmpl, cleanup_mode == CLEANUP_ALL);
if (start + tmpl.len <= sb->len &&
memcmp(tmpl.buf, sb->buf + start, tmpl.len) == 0)
start += tmpl.len;
}
strbuf_release(&tmpl);

/* Check if the rest is just whitespace and Signed-of-by's. */
for (i = start; i < sb->len; i++) {
Expand All @@ -948,6 +947,40 @@ static int message_is_empty(struct strbuf *sb)
return 1;
}

/*
* Find out if the message in the strbuf contains only whitespace and
* Signed-off-by lines.
*/
static int message_is_empty(struct strbuf *sb)
{
if (cleanup_mode == CLEANUP_NONE && sb->len)
return 0;
return rest_is_empty(sb, 0);
}

/*
* See if the user edited the message in the editor or left what
* was in the template intact
*/
static int template_untouched(struct strbuf *sb)
{
struct strbuf tmpl = STRBUF_INIT;
char *start;

if (cleanup_mode == CLEANUP_NONE && sb->len)
return 0;

if (!template_file || strbuf_read_file(&tmpl, template_file, 0) <= 0)
return 0;

stripspace(&tmpl, cleanup_mode == CLEANUP_ALL);
start = (char *)skip_prefix(sb->buf, tmpl.buf);
if (!start)
start = sb->buf;
strbuf_release(&tmpl);
return rest_is_empty(sb, start - sb->buf);
}

static const char *find_author_by_nickname(const char *name)
{
struct rev_info revs;
Expand Down Expand Up @@ -1055,6 +1088,8 @@ static int parse_and_validate_options(int argc, const char *argv[],
die(_("Only one of -c/-C/-F/--fixup can be used."));
if (message.len && f > 0)
die((_("Option -m cannot be combined with -c/-C/-F/--fixup.")));
if (f || message.len)
template_file = NULL;
if (edit_message)
use_message = edit_message;
if (amend && !use_message && !fixup_message)
Expand Down Expand Up @@ -1494,6 +1529,11 @@ int cmd_commit(int argc, const char **argv, const char *prefix)

if (cleanup_mode != CLEANUP_NONE)
stripspace(&sb, cleanup_mode == CLEANUP_ALL);
if (template_untouched(&sb) && !allow_empty_message) {
rollback_index_files();
fprintf(stderr, _("Aborting commit; you did not edit the message.\n"));
exit(1);
}
if (message_is_empty(&sb) && !allow_empty_message) {
rollback_index_files();
fprintf(stderr, _("Aborting commit due to empty commit message.\n"));
Expand Down
2 changes: 1 addition & 1 deletion builtin/diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
add_head_to_pending(&rev);
if (!rev.pending.nr) {
struct tree *tree;
tree = lookup_tree((const unsigned char*)EMPTY_TREE_SHA1_BIN);
tree = lookup_tree(EMPTY_TREE_SHA1_BIN);
add_pending_object(&rev, &tree->object, "HEAD");
}
break;
Expand Down
26 changes: 18 additions & 8 deletions builtin/push.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ static void set_refspecs(const char **refs, int nr)
}
}

static int push_url_of_remote(struct remote *remote, const char ***url_p)
{
if (remote->pushurl_nr) {
*url_p = remote->pushurl;
return remote->pushurl_nr;
}
*url_p = remote->url;
return remote->url_nr;
}

static void setup_push_upstream(struct remote *remote)
{
struct strbuf refspec = STRBUF_INIT;
Expand All @@ -76,7 +86,7 @@ static void setup_push_upstream(struct remote *remote)
"\n"
" git push %s HEAD:<name-of-remote-branch>\n"),
remote->name);
if (!branch->merge_nr || !branch->merge)
if (!branch->merge_nr || !branch->merge || !branch->remote_name)
die(_("The current branch %s has no upstream branch.\n"
"To push the current branch and set the remote as upstream, use\n"
"\n"
Expand All @@ -87,6 +97,12 @@ static void setup_push_upstream(struct remote *remote)
if (branch->merge_nr != 1)
die(_("The current branch %s has multiple upstream branches, "
"refusing to push."), branch->name);
if (strcmp(branch->remote_name, remote->name))
die(_("You are pushing to remote '%s', which is not the upstream of\n"
"your current branch '%s', without telling me what to push\n"
"to update which remote branch."),
remote->name, branch->name);

strbuf_addf(&refspec, "%s:%s", branch->name, branch->merge[0]->src);
add_refspec(refspec.buf);
}
Expand Down Expand Up @@ -196,13 +212,7 @@ static int do_push(const char *repo, int flags)
setup_default_push_refspecs(remote);
}
errs = 0;
if (remote->pushurl_nr) {
url = remote->pushurl;
url_nr = remote->pushurl_nr;
} else {
url = remote->url;
url_nr = remote->url_nr;
}
url_nr = push_url_of_remote(remote, &url);
if (url_nr) {
for (i = 0; i < url_nr; i++) {
struct transport *transport =
Expand Down
2 changes: 1 addition & 1 deletion bundle.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ int create_bundle(struct bundle_header *header, const char *path,
argc = setup_revisions(argc, argv, &revs, NULL);

if (argc > 1)
return error("unrecognized argument: %s'", argv[1]);
return error("unrecognized argument: %s", argv[1]);

object_array_remove_duplicates(&revs.pending);

Expand Down
Loading

0 comments on commit b240ea2

Please sign in to comment.