From 4fc970c43884e6215c13d6944a2def1eb2134ed5 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 25 Feb 2007 22:24:47 -0800 Subject: [PATCH 1/4] diff --cc: fix display of symlink conflicts during a merge. "git-diff-files --cc" to show conflicts during merge did not pass the correct mode information for the working tree down, and showed bogus combined diff. Signed-off-by: Junio C Hamano --- combine-diff.c | 25 +++++++++++++++++++++---- diff-lib.c | 16 +++++++++++++--- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/combine-diff.c b/combine-diff.c index a5f2c8dd4a..6b7c6be959 100644 --- a/combine-diff.c +++ b/combine-diff.c @@ -678,9 +678,25 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent, else { /* Used by diff-tree to read from the working tree */ struct stat st; - int fd; - if (0 <= (fd = open(elem->path, O_RDONLY)) && - !fstat(fd, &st)) { + int fd = -1; + + if (lstat(elem->path, &st) < 0) + goto deleted_file; + + if (S_ISLNK(st.st_mode)) { + int len = st.st_size; + result_size = len; + result = xmalloc(len + 1); + if (result_size != readlink(elem->path, result, len)) { + error("readlink(%s): %s", elem->path, + strerror(errno)); + return; + } + result[len] = 0; + elem->mode = canon_mode(st.st_mode); + } + else if (0 <= (fd = open(elem->path, O_RDONLY)) && + !fstat(fd, &st)) { int len = st.st_size; int sz = 0; @@ -698,11 +714,12 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent, result[len] = 0; } else { - /* deleted file */ + deleted_file: result_size = 0; elem->mode = 0; result = xcalloc(1, 1); } + if (0 <= fd) close(fd); } diff --git a/diff-lib.c b/diff-lib.c index 556d5345bf..60c0fa6488 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -41,17 +41,27 @@ int run_diff_files(struct rev_info *revs, int silent_on_removed) path_len = ce_namelen(ce); - dpath = xmalloc (combine_diff_path_size (5, path_len)); + dpath = xmalloc(combine_diff_path_size(5, path_len)); dpath->path = (char *) &(dpath->parent[5]); dpath->next = NULL; dpath->len = path_len; memcpy(dpath->path, ce->name, path_len); dpath->path[path_len] = '\0'; - dpath->mode = 0; hashclr(dpath->sha1); memset(&(dpath->parent[0]), 0, - sizeof(struct combine_diff_parent)*5); + sizeof(struct combine_diff_parent)*5); + + if (lstat(ce->name, &st) < 0) { + if (errno != ENOENT && errno != ENOTDIR) { + perror(ce->name); + continue; + } + if (silent_on_removed) + continue; + } + else + dpath->mode = canon_mode(st.st_mode); while (i < entries) { struct cache_entry *nce = active_cache[i]; From c5ddca1fff44896b7e94801da75392ccc234060c Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 25 Feb 2007 23:26:11 -0800 Subject: [PATCH 2/4] Documentation: describe "-f/-t/-m" options to "git-remote add" Signed-off-by: Junio C Hamano --- Documentation/git-remote.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Documentation/git-remote.txt b/Documentation/git-remote.txt index a60c31a315..a2ff8f098e 100644 --- a/Documentation/git-remote.txt +++ b/Documentation/git-remote.txt @@ -31,6 +31,19 @@ subcommands are available to perform operations on the remotes. Adds a remote named for the repository at . The command `git fetch ` can then be used to create and update remote-tracking branches /. ++ +With `-f` option, `git fetch ` is run immediately after +the remote information is set up. ++ +With `-t ` option, instead of the default glob +refspec for the remote to track all branches under +`$GIT_DIR/remotes//`, a refspec to track only `` +is created. You can give more than one `-t ` to track +multiple branche without grabbing all branches. ++ +With `-m ` option, `$GIT_DIR/remotes//HEAD` is set +up to point at remote's `` branch instead of whatever +branch the `HEAD` at the remote repository actually points at. 'show':: From 4e5104c1fc42e440b9f086d428157d45897e1273 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Wed, 21 Feb 2007 00:03:36 -0500 Subject: [PATCH 3/4] git-remote: support remotes with a dot in the name [jc: the original from Pavel was limiting the variable names to only fetch and url, but I loosened it to take valid variable names.] [jc: cherry-picked from 'master', since people seem to be reinventing this many times.] Signed-off-by: Pavel Roskin Signed-off-by: Junio C Hamano --- git-remote.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-remote.perl b/git-remote.perl index c56c5a84a4..670bafb6d0 100755 --- a/git-remote.perl +++ b/git-remote.perl @@ -67,7 +67,7 @@ sub list_remote { $git->command(qw(config --get-regexp), '^remote\.'); }; for (@remotes) { - if (/^remote\.([^.]*)\.(\S*)\s+(.*)$/) { + if (/^remote\.(\S+?)\.([^.\s]+)\s+(.*)$/) { add_remote_config(\%seen, $1, $2, $3); } } From 0d9b9ab1284ce125fd49cf7dbf4d28e0540cf035 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 25 Feb 2007 23:58:50 -0800 Subject: [PATCH 4/4] GIT 1.5.0.2 Signed-off-by: Junio C Hamano --- Documentation/RelNotes-1.5.0.2.txt | 28 +++++++++++++++++----------- GIT-VERSION-GEN | 2 +- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Documentation/RelNotes-1.5.0.2.txt b/Documentation/RelNotes-1.5.0.2.txt index 4dc1344859..b061e50ff0 100644 --- a/Documentation/RelNotes-1.5.0.2.txt +++ b/Documentation/RelNotes-1.5.0.2.txt @@ -6,6 +6,14 @@ Fixes since v1.5.0.1 * Bugfixes + - Automated merge conflict handling when changes to symbolic + links conflicted were completely broken. The merge-resolve + strategy created a regular file with conflict markers in it + in place of the symbolic link. The default strategy, + merge-recursive was even more broken. It removed the path + that was pointed at by the symbolic link. Both of these + problems have been fixed. + - 'git diff maint master next' did not correctly give combined diff across three trees. @@ -39,21 +47,19 @@ Fixes since v1.5.0.1 impossible to repack after accumulating many (small) packs in the repository. + - 'git-diff' to review the combined diff during a conflicted + merge were not reading the working tree version correctly + when changes to a symbolic link conflicted. It should have + read the data using readlink(2) but read from the regular + file the symbolic link pointed at. + + - 'git-remote' did not like period in a remote's name. + * Documentation updates - added and clarified core.bare, core.legacyheaders configurations. - updated "git-clone --depth" documentation. + * Assorted git-gui fixes. - - --- -exec >/var/tmp/1 -O=v1.5.0.1-35-gffa84ff -echo O=`git describe maint` -git shortlog --no-merges $O..maint - -#Local Variables: -#mode: text -#End: diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 9133a00b23..32a9422336 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v1.5.0.1.GIT +DEF_VER=v1.5.0.2.GIT LF=' '