* [PATCH 3/6] Test "git remote show" and "git remote prune"
From: Johannes Schindelin @ 2007-12-05 19:02 UTC (permalink / raw)
To: git, gitster
In-Reply-To: <Pine.LNX.4.64.0712051858270.27959@racer.site>
While at it, also fix a few instances where a cd was done outside of a
subshell.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
t/t5505-remote.sh | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index 636aec2..c7d7242 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -97,4 +97,38 @@ test_expect_success 'remove remote' '
)
'
+cat > test/expect << EOF
+* remote origin
+ URL: $(pwd)/one/.git
+ Remote branch(es) merged with 'git pull' while on branch master
+ master
+ New remote branches (next fetch will store in remotes/origin)
+ master
+ Tracked remote branches
+ side master
+EOF
+
+test_expect_success 'show' '
+ (cd test &&
+ git config --add remote.origin.fetch \
+ refs/heads/master:refs/heads/upstream &&
+ git fetch &&
+ git branch -d -r origin/master &&
+ (cd ../one &&
+ echo 1 > file &&
+ git commit -m update file) &&
+ git remote show origin > output &&
+ git diff expect output)
+'
+
+test_expect_success 'prune' '
+ (cd one &&
+ git branch -m side side2) &&
+ (cd test &&
+ git fetch origin &&
+ git remote prune origin &&
+ git rev-parse refs/remotes/origin/side2 &&
+ ! git rev-parse refs/remotes/origin/side)
+'
+
test_done
--
1.5.3.7.2157.g9598e
^ permalink raw reply related
* Re: your mail
From: Johannes Schindelin @ 2007-12-05 19:01 UTC (permalink / raw)
To: git, gitster
In-Reply-To: <Pine.LNX.4.64.0712051900370.27959@racer.site>
Hi,
On Wed, 5 Dec 2007, Johannes Schindelin wrote:
> [PATCH 1/6] path-list: add functions to work with unsorted lists
Ooops.
Sorry,
Dscho
^ permalink raw reply
* [PATCH 2/6] parseopt: add flag to stop on first non option
From: Johannes Schindelin @ 2007-12-05 19:01 UTC (permalink / raw)
To: git, gitster
In-Reply-To: <Pine.LNX.4.64.0712051858270.27959@racer.site>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
This allows "git remote --option command --command-option".
parse-options.c | 2 ++
parse-options.h | 1 +
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/parse-options.c b/parse-options.c
index e12b428..6df1230 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -229,6 +229,8 @@ int parse_options(int argc, const char **argv, const struct option *options,
const char *arg = args.argv[0];
if (*arg != '-' || !arg[1]) {
+ if (flags & PARSE_OPT_STOP_AT_NON_OPTION)
+ break;
argv[j++] = args.argv[0];
continue;
}
diff --git a/parse-options.h b/parse-options.h
index 102ac31..0d40cd2 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -18,6 +18,7 @@ enum parse_opt_type {
enum parse_opt_flags {
PARSE_OPT_KEEP_DASHDASH = 1,
+ PARSE_OPT_STOP_AT_NON_OPTION = 2,
};
enum parse_opt_option_flags {
--
1.5.3.7.2157.g9598e
^ permalink raw reply related
* (unknown)
From: Johannes Schindelin @ 2007-12-05 19:00 UTC (permalink / raw)
To: git, gitster
In-Reply-To: <Pine.LNX.4.64.0712051858270.27959@racer.site>
[PATCH 1/6] path-list: add functions to work with unsorted lists
Up to now, path-lists were sorted at all times. But sometimes it
is much more convenient to build the list and sort it at the end,
or sort it not at all.
Add path_list_append() and sort_path_list() to allow that.
Also, add the unsorted_path_list_has_path() function, to do a linear
search.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
I should have done this much earlier...
path-list.c | 30 ++++++++++++++++++++++++++++++
path-list.h | 8 +++++++-
2 files changed, 37 insertions(+), 1 deletions(-)
diff --git a/path-list.c b/path-list.c
index 3d83b7b..92e5cf2 100644
--- a/path-list.c
+++ b/path-list.c
@@ -102,3 +102,33 @@ void print_path_list(const char *text, const struct path_list *p)
for (i = 0; i < p->nr; i++)
printf("%s:%p\n", p->items[i].path, p->items[i].util);
}
+
+struct path_list_item *path_list_append(const char *path, struct path_list *list)
+{
+ ALLOC_GROW(list->items, list->nr + 1, list->alloc);
+ list->items[list->nr].path =
+ list->strdup_paths ? xstrdup(path) : (char *)path;
+ return list->items + list->nr++;
+}
+
+static int cmp_items(const void *a, const void *b)
+{
+ const struct path_list_item *one = a;
+ const struct path_list_item *two = b;
+ return strcmp(one->path, two->path);
+}
+
+void sort_path_list(struct path_list *list)
+{
+ qsort(list->items, list->nr, sizeof(*list->items), cmp_items);
+}
+
+int unsorted_path_list_has_path(struct path_list *list, const char *path)
+{
+ int i;
+ for (i = 0; i < list->nr; i++)
+ if (!strcmp(path, list->items[i].path))
+ return 1;
+ return 0;
+}
+
diff --git a/path-list.h b/path-list.h
index 5931e2c..ca2cbba 100644
--- a/path-list.h
+++ b/path-list.h
@@ -13,10 +13,16 @@ struct path_list
};
void print_path_list(const char *text, const struct path_list *p);
+void path_list_clear(struct path_list *list, int free_util);
+/* Use these functions only on sorted lists: */
int path_list_has_path(const struct path_list *list, const char *path);
-void path_list_clear(struct path_list *list, int free_util);
struct path_list_item *path_list_insert(const char *path, struct path_list *list);
struct path_list_item *path_list_lookup(const char *path, struct path_list *list);
+/* Use these functions only on unsorted lists: */
+struct path_list_item *path_list_append(const char *path, struct path_list *list);
+void sort_path_list(struct path_list *list);
+int unsorted_path_list_has_path(struct path_list *list, const char *path);
+
#endif /* PATH_LIST_H */
--
1.5.3.7.2157.g9598e
^ permalink raw reply related
* [PATCH 0/6] builtin-remote
From: Johannes Schindelin @ 2007-12-05 19:00 UTC (permalink / raw)
To: git, gitster
Hi,
this series introduces remote as a builtin, and fixes a long-standing bug
(if you created a remote with --mirror, prune would not do the right
thing).
I know it is pretty late in the game for 1.5.4, but then, I do not expect
this to go into that version...
Ciao,
Dscho
^ permalink raw reply
* Re: * [BUG] "git clean" does not pay attention to its parameters
From: Jeff King @ 2007-12-05 18:03 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Nanako Shiraishi, Shawn Bohrer, git
In-Reply-To: <7veje1zibm.fsf@gitster.siamese.dyndns.org>
On Tue, Dec 04, 2007 at 11:55:41PM -0800, Junio C Hamano wrote:
> Yuck. People actually use git-clean?
I use it all the time (though never with arguments, or I probably would
have noticed this bug). I think it is coupled with the "use git status
to see what is going on" workflow that, IIRC, you don't use.
Also, nit: don't you mean "git clean"? :)
-Peff
^ permalink raw reply
* [PATCH] Compile fix for SCO OpenServer
From: Aidan Van Dyk @ 2007-12-05 17:21 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 742 bytes --]
SCO OpenServer hides the definitions of (at least) u_short and friends if
_XOPEN_SOURCE is defined.
Signed-off-by: Aidan Van Dyk <aidan@highrise.ca>
---
diff --git a/git-compat-util.h b/git-compat-util.h
index ca0a597..be8cbe8 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -24,7 +24,7 @@
/* Approximation of the length of the decimal representation of this type. */
#define decimal_length(x) ((int)(sizeof(x) * 2.56 + 0.5) + 1)
-#if !defined(__APPLE__) && !defined(__FreeBSD__)
+#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined (__OPENSERVER__)
#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
#endif
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply related
* Re: Put part of working tree on another file-system.
From: Sergei Organov @ 2007-12-05 17:07 UTC (permalink / raw)
To: Rogan Dawes; +Cc: git
In-Reply-To: <4756C51C.8080608@dawes.za.net>
Rogan Dawes <lists@dawes.za.net> writes:
> Sergei Organov wrote:
>> Hello,
>>
>> I've a desire to put a sub-tree of my working tree into another
>> file-system. With CVS I've used symlink to achieve this. It works fine
>> with CVS as it doesn't care about directories and symlinks at all. I had
>> little hope it will work with GIT, but I've performed a test anyway. To
>> my surprise it almost worked, so I have a hope that maybe it's not that
>> difficult to support this. What do you think? Or maybe there is a
>> different way to achieve the goal with GIT?
>>
>
> I needed to do this in Cygwin, and saw the same behaviour. I worked
> around it by using cygwin's "mount" command to "mount" the other
> directory in Cygwin's namespace. With this done, cygwin does not
> detect a symlink (since there is none), and works as expected.
>
> With sufficient permissions, you can probably achieve the same effect
> with bind mounts perhaps (assuming Linux, of course).
Thanks for the idea, -- it seems to work.
[In fact it is Linux, and those "another file-system" is FAT32 partition,
so that, when rebooting to Windoze, this directory could be accessed from
there. I can't put all the working tree there as there are parts of the
tree that depend on file system being case-sensitive.]
--
Sergei.
^ permalink raw reply
* builtin command's prefix question
From: Nguyen Thai Ngoc Duy @ 2007-12-05 16:56 UTC (permalink / raw)
To: Git Mailing List
Hi,
I have been looking at setup_git_directory_gently() lately. From my
understanding, setup_git_directory* will return a string called
"prefix" that is passed to builtin commands. What is the exact meaning
of this prefix? Correct me if I'm wrong. In early (read: no worktree)
days, cwd was moved to working root directory and prefix contained
relative path from working root directory to the original cwd. So it
had a few implications:
1. A non-empty prefix indicates cwd has been moved
2. If cwd is moved, it is moved to working root directory
3. cwd+prefix should point to the current directory at the time the
command was issued (let's call it "user cwd")
Things change a bit since the rise of worktree:
- If GIT_DIR is set and GIT_WORK_TREE is not, prefix is relative to
the to-be-set-up worktree, but cwd is not changed, so point 3 is gone.
- If GIT_DIR is not set and GiT_WORK_TREE is,
- and it is found that user cwd is inside a gitdir (bare repo), cwd
has been moved and prefix is empty, cwd+prefix no longer point to user
cwd
- for other cases, cwd may not be worktree (the real worktree will
be setup in setup_work_tree or setup_git_directory)
Now that setup_work_tree can move cwd, it should also change prefix to
meet point 3. But it does not.
I feel dizzy now. Were my assumptions wrong? What is expected behavior
of setup_git_directory_gently()?
--
Duy
^ permalink raw reply
* Re: [PATCH/RFC] autoconf: Add test for OLD_ICONV
From: Jakub Narebski @ 2007-12-05 16:52 UTC (permalink / raw)
To: Wincent Colaiuta
Cc: git, Junio C Hamano, Ramsay Jones, Arjen Laarhoven,
Brian Gernhardt
In-Reply-To: <ADB12552-AD67-4781-B194-AD15CA4A7B44@wincent.com>
On Wed, 5 December 2007, Wincent Colaiuta wrote:
> El 5/12/2007, a las 16:45, Jakub Narebski escribió:
>
> > Update configure.ac (and config.mak.in) to keep up with git
> > development by adding [compile] test whether your library has
> > an old iconv(), where the second (input buffer pointer) parameter
> > is declared with type (const char **) (OLD_ICONV).
> >
> > Signed-off-by: Jakub Narebski <jnareb@gmail.com>
> > ---
> > This patch needs checking if it correctly sets OLD_ICONV
> > when needed. I have checked only that it is not set when
> > with new iconv() declaration. Could people using Cygwin
> > (and other with OLD_ICONV: Darwin) test it?
>
> Before applying your patch:
>
> CC utf8.o
> utf8.c: In function ‘reencode_string’:
> utf8.c:328: warning: passing argument 2 of ‘iconv’ from incompatible
> pointer type
> CC convert.o
>
> After applying your patch:
>
> CC utf8.o
> CC convert.o
Do I understand correctly that above is excerpt from the output of the
following sequence of commands before and after this patch applied?
$ make configure
$ ./configure [options]
$ make
Do you have something like below in ./configure output?
configure: CHECKS for header files
checking for old iconv()... yes
> This on Darwin Kernel Version 9.1.0 (Mac OS X 10.5.1).
Strange... in Makefile there is
ifeq ($(uname_S),Darwin)
NEEDS_SSL_WITH_CRYPTO = YesPlease
NEEDS_LIBICONV = YesPlease
OLD_ICONV = UnfortunatelyYes
NO_STRLCPY = YesPlease
NO_MEMMEM = YesPlease
endif
so the uname based guessing should set OLD_ICONV on Darwin...
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: [PATCH/RFC] autoconf: Add test for OLD_ICONV
From: Jakub Narebski @ 2007-12-05 16:33 UTC (permalink / raw)
To: Brian Gernhardt; +Cc: git
In-Reply-To: <82D48BF0-E01D-4CE4-92F3-44B555531624@silverinsanity.com>
On Wed, 5 Dec 2007, Brian Gernhardt wrote:
> On Dec 5, 2007, at 10:45 AM, Jakub Narebski wrote:
>
> > This patch needs checking if it correctly sets OLD_ICONV
> > when needed. I have checked only that it is not set when
> > with new iconv() declaration. Could people using Cygwin
> > (and other with OLD_ICONV: Darwin) test it?
>
> I could not get git am to apply the patch cleanly, but will try again
> later when I have more time.
Hmmm... it should apply cleanly to both 'master' (7a4a2e1f797)
and 'next' (bd1cfb7fbddc). It just adds some contents...
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: [PATCH/RFC] autoconf: Add test for OLD_ICONV
From: Wincent Colaiuta @ 2007-12-05 16:31 UTC (permalink / raw)
To: Jakub Narebski
Cc: git, Junio C Hamano, Ramsay Jones, Arjen Laarhoven,
Brian Gernhardt
In-Reply-To: <1196869526-2197-1-git-send-email-jnareb@gmail.com>
El 5/12/2007, a las 16:45, Jakub Narebski escribió:
> Update configure.ac (and config.mak.in) to keep up with git
> development by adding [compile] test whether your library has
> an old iconv(), where the second (input buffer pointer) parameter
> is declared with type (const char **) (OLD_ICONV).
>
> Signed-off-by: Jakub Narebski <jnareb@gmail.com>
> ---
> This patch needs checking if it correctly sets OLD_ICONV
> when needed. I have checked only that it is not set when
> with new iconv() declaration. Could people using Cygwin
> (and other with OLD_ICONV: Darwin) test it?
Before applying your patch:
CC utf8.o
utf8.c: In function ‘reencode_string’:
utf8.c:328: warning: passing argument 2 of ‘iconv’ from incompatible
pointer type
CC convert.o
After applying your patch:
CC utf8.o
CC convert.o
This on Darwin Kernel Version 9.1.0 (Mac OS X 10.5.1).
Cheers,
Wincent
^ permalink raw reply
* Re: How to jump between two repositories ...
From: Andreas Ericsson @ 2007-12-05 16:19 UTC (permalink / raw)
To: g2; +Cc: git
In-Reply-To: <9F403ACE-62C0-4A6D-945C-3DA6DF0316B8@gmail.com>
post
top-
don't
Please
g2 wrote:
>
> How do you safely push to the repository? Even if my receiving
> repository is pristine (the last command I do is a commit), after I push
> into it, some files in the work-tree are effectively out of date and git
> says so by thinking they are modified and staged for commit. My original
> set of example commands illustrates this. What set of commands do you
> use to avoid the problem?
>
Vanilla git-push, ofcourse. I just make sure to run "git reset --hard" in
the receiving repo before using anything in it. Granted, it's "safe"
because I know I never want to use any changes from those repos and not.
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231
^ permalink raw reply
* Re: [PATCH/RFC] autoconf: Add test for OLD_ICONV
From: Brian Gernhardt @ 2007-12-05 16:11 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git, Junio C Hamano, Ramsay Jones, Arjen Laarhoven
In-Reply-To: <1196869526-2197-1-git-send-email-jnareb@gmail.com>
On Dec 5, 2007, at 10:45 AM, Jakub Narebski wrote:
> Update configure.ac (and config.mak.in) to keep up with git
> development by adding [compile] test whether your library has
> an old iconv(), where the second (input buffer pointer) parameter
> is declared with type (const char **) (OLD_ICONV).
>
> Signed-off-by: Jakub Narebski <jnareb@gmail.com>
> ---
> This patch needs checking if it correctly sets OLD_ICONV
> when needed. I have checked only that it is not set when
> with new iconv() declaration. Could people using Cygwin
> (and other with OLD_ICONV: Darwin) test it?
I could not get git am to apply the patch cleanly, but will try again
later when I have more time. That said, 10.5's default /usr/include/
iconv.h uses the newer non-const definition of iconv_open. I've had
to add a "OLD_ICONV=" line to my config.mak to avoid the warning.
I'll still test to look for a false positive.
> P.S. Is there any convention on where to use YesPlease, and where
> UnfortunatelyYes when setting Makefile build configuration variables?
AFAICT, YesPlease is the "normal" choice and UnfortunatelyYes is used
when the person who added it considered it an obnoxious hack or a
stupid failing in a system. The test in the Makefile is just if the
variable is defined, so you technically could use
"IDontLikeSillyVariableValuesInMyMakefiles", and it would work just
fine. ;-)
~~ Brian
^ permalink raw reply
* [PATCH/RFC] autoconf: Add test for OLD_ICONV
From: Jakub Narebski @ 2007-12-05 15:45 UTC (permalink / raw)
To: git
Cc: Junio C Hamano, Ramsay Jones, Arjen Laarhoven, Brian Gernhardt,
Jakub Narebski
In-Reply-To: <7vd4u5l29v.fsf@gitster.siamese.dyndns.org>
Update configure.ac (and config.mak.in) to keep up with git
development by adding [compile] test whether your library has
an old iconv(), where the second (input buffer pointer) parameter
is declared with type (const char **) (OLD_ICONV).
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This patch needs checking if it correctly sets OLD_ICONV
when needed. I have checked only that it is not set when
with new iconv() declaration. Could people using Cygwin
(and other with OLD_ICONV: Darwin) test it?
I should probably used AC_LANG_PROGRAM like for NO_C99_FORMAT instead
of generating whole programlet^W test program by hand (I hope that for
example I haven't missed some header file which needs to be included);
I have followed example for NO_ICONV / NEEDS_LIBICONV and
NO_DEFLATE_BOUND test. I'm also not sure if I have put this test in
the correct autoconf section, but that is probably matter of taste.
P.S. Is there any convention on where to use YesPlease, and where
UnfortunatelyYes when setting Makefile build configuration variables?
config.mak.in | 1 +
configure.ac | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/config.mak.in b/config.mak.in
index 11d256e..7d5df9b 100644
--- a/config.mak.in
+++ b/config.mak.in
@@ -41,4 +41,5 @@ NO_STRTOUMAX=@NO_STRTOUMAX@
NO_SETENV=@NO_SETENV@
NO_MKDTEMP=@NO_MKDTEMP@
NO_ICONV=@NO_ICONV@
+OLD_ICONV=@OLD_ICONV@
NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@
diff --git a/configure.ac b/configure.ac
index 5f8a15b..5d2936e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -212,6 +212,27 @@ test -n "$NEEDS_SOCKET" && LIBS="$LIBS -lsocket"
## Checks for header files.
+AC_MSG_NOTICE([CHECKS for header files])
+#
+# Define OLD_ICONV if your library has an old iconv(), where the second
+# (input buffer pointer) parameter is declared with type (const char **).
+AC_DEFUN([OLDICONVTEST_SRC], [[
+#include <iconv.h>
+
+int main(void)
+{
+ iconv_t cd;
+ char *ibp, *obp;
+ size_t insz, outsz;
+ iconv(cd, &ibp, &insz, &obp, &outsz);
+}
+]])
+AC_MSG_CHECKING([for old iconv()])
+AC_COMPILE_IFELSE(OLDICONVTEST_SRC,
+ [AC_MSG_RESULT([no])],
+ [AC_MSG_RESULT([yes])
+ OLD_ICONV=YesPlease])
+AC_SUBST(OLD_ICONV)
## Checks for typedefs, structures, and compiler characteristics.
--
1.5.3.6
^ permalink raw reply related
* Re: [PATCH] Do check_repository_format() early
From: Nguyen Thai Ngoc Duy @ 2007-12-05 15:39 UTC (permalink / raw)
To: git, Junio C Hamano, Johannes Schindelin
In-Reply-To: <20071205132514.GA5580@laptop>
On Dec 5, 2007 8:33 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
> @@ -287,6 +310,8 @@ const char *setup_git_directory_gently(int *nongit_ok)
> if (!work_tree_env)
> inside_work_tree = 0;
> setenv(GIT_DIR_ENVIRONMENT, ".", 1);
> + if (check_repository_format_gently(nongit_ok))
> + return NULL;
> return NULL;
> }
> chdir("..");
This part better be as follow (patch may be damaged as I'm editing it in gmail)
@@ -287,6 +310,8 @@ const char *setup_git_directory_gently(int *nongit_ok)
if (!work_tree_env)
inside_work_tree = 0;
setenv(GIT_DIR_ENVIRONMENT, ".", 1);
+ check_repository_format_gently(nongit_ok);
return NULL;
}
chdir("..");
--
Duy
^ permalink raw reply
* Re: Put part of working tree on another file-system.
From: Rogan Dawes @ 2007-12-05 15:34 UTC (permalink / raw)
To: Sergei Organov; +Cc: git
In-Reply-To: <87mysp8ddk.fsf@osv.gnss.ru>
Sergei Organov wrote:
> Hello,
>
> I've a desire to put a sub-tree of my working tree into another
> file-system. With CVS I've used symlink to achieve this. It works fine
> with CVS as it doesn't care about directories and symlinks at all. I had
> little hope it will work with GIT, but I've performed a test anyway. To
> my surprise it almost worked, so I have a hope that maybe it's not that
> difficult to support this. What do you think? Or maybe there is a
> different way to achieve the goal with GIT?
>
I needed to do this in Cygwin, and saw the same behaviour. I worked
around it by using cygwin's "mount" command to "mount" the other
directory in Cygwin's namespace. With this done, cygwin does not detect
a symlink (since there is none), and works as expected.
With sufficient permissions, you can probably achieve the same effect
with bind mounts perhaps (assuming Linux, of course).
Rogan
^ permalink raw reply
* Re: How to jump between two repositories ...
From: g2 @ 2007-12-05 15:28 UTC (permalink / raw)
To: Andreas Ericsson; +Cc: git
In-Reply-To: <47566526.9010900@op5.se>
How do you safely push to the repository? Even if my receiving
repository is pristine (the last command I do is a commit), after I
push into it, some files in the work-tree are effectively out of date
and git says so by thinking they are modified and staged for commit.
My original set of example commands illustrates this. What set of
commands do you use to avoid the problem?
On 5-Dec-07, at 12:45 AM, Andreas Ericsson wrote:
>
> Yes it does. It just supports it badly. If there is a work-tree
> connected to
> the receiving repository and that work-tree is pristine, it would be
> safe and
> sane to write the newly pushed changes to the connected working tree.
>
> We do all our integration fixups by pushing to repositories with
> work-trees,
> simply because it's ridiculously inconvenient to add the
> infrastructure to
> pull to those repos from each individual developer. In that
> scenario, pushing
> to a checked out branch is highly useful and perfectly safe.
>
> --
> Andreas Ericsson andreas.ericsson@op5.se
> OP5 AB www.op5.se
> Tel: +46 8-230225 Fax: +46 8-230231
^ permalink raw reply
* Re: * [BUG] "git clean" does not pay attention to its parameters
From: Shawn Bohrer @ 2007-12-05 15:28 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Nanako Shiraishi, git
In-Reply-To: <7veje1zibm.fsf@gitster.siamese.dyndns.org>
On Tue, Dec 04, 2007 at 11:55:41PM -0800, Junio C Hamano wrote:
> Does this patch help? I am not sure why the directory side of the code
> is written that way, but I have a suspicion that "was a directory
> explicitly given as one of the pathspec" check is also bogus, although I
> did not touch that part.
Before the rewrite in C git clean would refuse to remove a directory if
you said:
git clean dir
without using the -d parameter. Per your suggestion this check causes
git clean to remove the directory anyway since you explicitly asked it
to.
^ permalink raw reply
* Re: [PATCH] git config: Don't rely on regexec() returning 1 on non-match
From: Johannes Schindelin @ 2007-12-05 15:14 UTC (permalink / raw)
To: Björn Steinbrink; +Cc: gitster, git
In-Reply-To: <1196867484-22188-1-git-send-email-B.Steinbrink@gmx.de>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 538 bytes --]
Hi,
On Wed, 5 Dec 2007, Björn Steinbrink wrote:
> Some systems don't return 1 from regexec() when the pattern does not
> match (notably HP-UX which returns 20). Fortunately, there's the
> REG_NOMATCH constant, which we can use as the expected return value
> and test for that instead of "1 XOR retval".
>
> Bug identified by Dscho and H.Merijn Brand.
>
> Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
> Tested-by: H.Merijn Brand <h.m.brand@xs4all.nl>
> Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>
ACK
Ciao,
Dscho
^ permalink raw reply
* [PATCH] git config: Don't rely on regexec() returning 1 on non-match
From: Björn Steinbrink @ 2007-12-05 15:11 UTC (permalink / raw)
To: gitster; +Cc: git, Björn Steinbrink, Johannes Schindelin
Some systems don't return 1 from regexec() when the pattern does not
match (notably HP-UX which returns 20). Fortunately, there's the
REG_NOMATCH constant, which we can use as the expected return value
and test for that instead of "1 XOR retval".
Bug identified by Dscho and H.Merijn Brand.
Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Tested-by: H.Merijn Brand <h.m.brand@xs4all.nl>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
builtin-config.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin-config.c b/builtin-config.c
index 4c9ded3..9fda4e4 100644
--- a/builtin-config.c
+++ b/builtin-config.c
@@ -11,7 +11,7 @@ static regex_t *regexp;
static int show_keys;
static int use_key_regexp;
static int do_all;
-static int do_not_match;
+static int expected_regexec_result;
static int seen;
static char delim = '=';
static char key_delim = ' ';
@@ -38,7 +38,7 @@ static int show_config(const char* key_, const char* value_)
if (use_key_regexp && regexec(key_regexp, key_, 0, NULL, 0))
return 0;
if (regexp != NULL &&
- (do_not_match ^
+ (expected_regexec_result !=
regexec(regexp, (value_?value_:""), 0, NULL, 0)))
return 0;
@@ -101,7 +101,7 @@ static int get_value(const char* key_, const char* regex_)
if (regex_) {
if (regex_[0] == '!') {
- do_not_match = 1;
+ expected_regexec_result = REG_NOMATCH;
regex_++;
}
--
1.5.3.GIT
^ permalink raw reply related
* Re: [PATCH] Color support for "git-add -i"
From: Wincent Colaiuta @ 2007-12-05 13:55 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Dan Zwell, Jeff King, git
In-Reply-To: <7vbq95tnk7.fsf@gitster.siamese.dyndns.org>
El 5/12/2007, a las 11:59, Junio C Hamano escribió:
> This is mostly lifted from earlier series by Dan Zwell, but updated to
> use "git config --get-color" to make it simpler and more consistent
> with
> commands written in C.
Tested here and seems to work well. This is a nice little bit of
usability polish.
Cheers,
Wincent
^ permalink raw reply
* Re: [PATCH] Color support for "git-add -i"
From: Wincent Colaiuta @ 2007-12-05 13:52 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Junio C Hamano, Dan Zwell, Jeff King, git
In-Reply-To: <475697BC.2090701@viscovery.net>
El 5/12/2007, a las 13:21, Johannes Sixt escribió:
> Junio C Hamano schrieb:
>> +color.interactive::
>> + When true (or `always`), always use colors in `git add
>> + --interactive`. When false (or `never`), never. When set to
>> + `auto`, use colors only when the output is to the
>> + terminal. Defaults to false.
>
> Any particular reason why color.interactive = true should be
> different from
> color.diff = true? See 57f2b842 ("color.diff = true" is not "always"
> anymore)
I wonder when you'd ever run an interactive command and not be in a
terminal? ie. it doesn't make much sense to ever do "git add -i >
foo", except perhaps from the test suite.
Notwithstanding, consistency for the sake of consistency is probably a
good thing.
Cheers,
Wincent
^ permalink raw reply
* [PATCH] Add option --path to allow to run tests with real systems
From: Nguyễn Thái Ngọc Duy @ 2007-12-05 13:45 UTC (permalink / raw)
To: git
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
As we have decided to move git-* to gitexecdir, we should
make sure it works.
I'm running tests with --path now and saw some errors. Some
of them could be from bugs of this patch. I haven't looked into
them yet.
t/lib-git-svn.sh | 2 +-
t/t0000-basic.sh | 6 +++---
t/t0040-parse-options.sh | 16 ++++++++--------
t/t4200-rerere.sh | 8 ++++----
t/t5301-sliding-window.sh | 2 +-
t/t5302-pack-index.sh | 4 ++--
t/test-lib.sh | 18 ++++++++++++++----
7 files changed, 33 insertions(+), 23 deletions(-)
diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh
index 8d4a447..fd60ebc 100644
--- a/t/lib-git-svn.sh
+++ b/t/lib-git-svn.sh
@@ -46,7 +46,7 @@ rawsvnrepo="$svnrepo"
svnrepo="file://$svnrepo"
poke() {
- test-chmtime +1 "$1"
+ $GIT_TEST_PATH/test-chmtime +1 "$1"
}
SVN_HTTPD_MODULE_PATH=${SVN_HTTPD_MODULE_PATH-'/usr/lib/apache2/modules'}
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index 4e49d59..f809163 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -289,12 +289,12 @@ test_expect_success 'absolute path works as expected' '
mkdir third &&
dir="$(cd .git; pwd -P)" &&
dir2=third/../second/other/.git &&
- test "$dir" = "$(test-absolute-path $dir2)" &&
+ test "$dir" = "$($GIT_TEST_PATH/test-absolute-path $dir2)" &&
file="$dir"/index &&
- test "$file" = "$(test-absolute-path $dir2/index)" &&
+ test "$file" = "$($GIT_TEST_PATH/test-absolute-path $dir2/index)" &&
ln -s ../first/file .git/syml &&
sym="$(cd first; pwd -P)"/file &&
- test "$sym" = "$(test-absolute-path $dir2/syml)"
+ test "$sym" = "$($GIT_TEST_PATH/test-absolute-path $dir2/syml)"
'
test_done
diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh
index 462fdf2..ca1cc9f 100755
--- a/t/t0040-parse-options.sh
+++ b/t/t0040-parse-options.sh
@@ -23,7 +23,7 @@ string options
EOF
test_expect_success 'test help' '
- ! test-parse-options -h > output 2> output.err &&
+ ! $GIT_TEST_PATH/test-parse-options -h > output 2> output.err &&
test ! -s output &&
git diff expect.err output.err
'
@@ -35,7 +35,7 @@ string: 123
EOF
test_expect_success 'short options' '
- test-parse-options -s123 -b -i 1729 -b > output 2> output.err &&
+ $GIT_TEST_PATH/test-parse-options -s123 -b -i 1729 -b > output 2> output.err &&
git diff expect output &&
test ! -s output.err
'
@@ -46,7 +46,7 @@ string: 321
EOF
test_expect_success 'long options' '
- test-parse-options --boolean --integer 1729 --boolean --string2=321 \
+ $GIT_TEST_PATH/test-parse-options --boolean --integer 1729 --boolean --string2=321 \
> output 2> output.err &&
test ! -s output.err &&
git diff expect output
@@ -62,7 +62,7 @@ arg 02: --boolean
EOF
test_expect_success 'intermingled arguments' '
- test-parse-options a1 --string 123 b1 --boolean -j 13 -- --boolean \
+ $GIT_TEST_PATH/test-parse-options a1 --string 123 b1 --boolean -j 13 -- --boolean \
> output 2> output.err &&
test ! -s output.err &&
git diff expect output
@@ -75,19 +75,19 @@ string: (not set)
EOF
test_expect_success 'unambiguously abbreviated option' '
- test-parse-options --int 2 --boolean --no-bo > output 2> output.err &&
+ $GIT_TEST_PATH/test-parse-options --int 2 --boolean --no-bo > output 2> output.err &&
test ! -s output.err &&
git diff expect output
'
test_expect_success 'unambiguously abbreviated option with "="' '
- test-parse-options --int=2 > output 2> output.err &&
+ $GIT_TEST_PATH/test-parse-options --int=2 > output 2> output.err &&
test ! -s output.err &&
git diff expect output
'
test_expect_failure 'ambiguously abbreviated option' '
- test-parse-options --strin 123;
+ $GIT_TEST_PATH/test-parse-options --strin 123;
test $? != 129
'
@@ -98,7 +98,7 @@ string: 123
EOF
test_expect_success 'non ambiguous option (after two options it abbreviates)' '
- test-parse-options --st 123 > output 2> output.err &&
+ $GIT_TEST_PATH/test-parse-options --st 123 > output 2> output.err &&
test ! -s output.err &&
git diff expect output
'
diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh
index cfcdb69..ddbae1d 100755
--- a/t/t4200-rerere.sh
+++ b/t/t4200-rerere.sh
@@ -149,16 +149,16 @@ just_over_15_days_ago=$((-1-15*86400))
almost_60_days_ago=$((60-60*86400))
just_over_60_days_ago=$((-1-60*86400))
-test-chmtime =$almost_60_days_ago $rr/preimage
-test-chmtime =$almost_15_days_ago $rr2/preimage
+$GIT_TEST_PATH/test-chmtime =$almost_60_days_ago $rr/preimage
+$GIT_TEST_PATH/test-chmtime =$almost_15_days_ago $rr2/preimage
test_expect_success 'garbage collection (part1)' 'git rerere gc'
test_expect_success 'young records still live' \
"test -f $rr/preimage && test -f $rr2/preimage"
-test-chmtime =$just_over_60_days_ago $rr/preimage
-test-chmtime =$just_over_15_days_ago $rr2/preimage
+$GIT_TEST_PATH/test-chmtime =$just_over_60_days_ago $rr/preimage
+$GIT_TEST_PATH/test-chmtime =$just_over_15_days_ago $rr2/preimage
test_expect_success 'garbage collection (part2)' 'git rerere gc'
diff --git a/t/t5301-sliding-window.sh b/t/t5301-sliding-window.sh
index 073ac0c..8327051 100755
--- a/t/t5301-sliding-window.sh
+++ b/t/t5301-sliding-window.sh
@@ -12,7 +12,7 @@ test_expect_success \
for i in a b c
do
echo $i >$i &&
- test-genrandom "$i" 32768 >>$i &&
+ $GIT_TEST_PATH/test-genrandom "$i" 32768 >>$i &&
git update-index --add $i || return 1
done &&
echo d >d && cat c >>d && git update-index --add d &&
diff --git a/t/t5302-pack-index.sh b/t/t5302-pack-index.sh
index 2a2878b..0ae9cd8 100755
--- a/t/t5302-pack-index.sh
+++ b/t/t5302-pack-index.sh
@@ -15,11 +15,11 @@ test_expect_success \
do
i=`printf '%03i' $i`
echo $i >file_$i &&
- test-genrandom "$i" 8192 >>file_$i &&
+ $GIT_TEST_PATH/test-genrandom "$i" 8192 >>file_$i &&
git update-index --add file_$i &&
i=`expr $i + 1` || return 1
done &&
- { echo 101 && test-genrandom 100 8192; } >file_101 &&
+ { echo 101 && $GIT_TEST_PATH/test-genrandom 100 8192; } >file_101 &&
git update-index --add file_101 &&
tree=`git write-tree` &&
commit=`git commit-tree $tree </dev/null` && {
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 90b6844..50a3551 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -84,6 +84,8 @@ do
--no-python)
# noop now...
shift ;;
+ --path=*)
+ path="${1#*=}"; shift ;;
*)
break ;;
esac
@@ -296,11 +298,19 @@ test_done () {
# Test the binaries we have just built. The tests are kept in
# t/ subdirectory and are run in trash subdirectory.
-PATH=$(pwd)/..:$PATH
-GIT_EXEC_PATH=$(pwd)/..
+if [ -n "$path" ]; then
+ [ -x "$path/git" ] || error "git not found in $path"
+ PATH="$path":$PATH
+ export PATH
+ GIT_EXEC_PATH="$(git --exec-path)"
+else
+ PATH=$(pwd)/..:$PATH
+ GIT_EXEC_PATH=$(pwd)/..
+fi
+GIT_TEST_PATH=$(pwd)/..
GIT_TEMPLATE_DIR=$(pwd)/../templates/blt
GIT_CONFIG=.git/config
-export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG
+export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG GIT_TEST_PATH
GITPERLLIB=$(pwd)/../perl/blib/lib:$(pwd)/../perl/blib/arch/auto/Git
export GITPERLLIB
@@ -308,7 +318,7 @@ test -d ../templates/blt || {
error "You haven't built things yet, have you?"
}
-if ! test -x ../test-chmtime; then
+if ! test -x $GIT_TEST_PATH/test-chmtime; then
echo >&2 'You need to build test-chmtime:'
echo >&2 'Run "make test-chmtime" in the source (toplevel) directory'
exit 1
--
1.5.3.6.2040.gcdff-dirty
^ permalink raw reply related
* Put part of working tree on another file-system.
From: Sergei Organov @ 2007-12-05 13:44 UTC (permalink / raw)
To: git
Hello,
I've a desire to put a sub-tree of my working tree into another
file-system. With CVS I've used symlink to achieve this. It works fine
with CVS as it doesn't care about directories and symlinks at all. I had
little hope it will work with GIT, but I've performed a test anyway. To
my surprise it almost worked, so I have a hope that maybe it's not that
difficult to support this. What do you think? Or maybe there is a
different way to achieve the goal with GIT?
The test has been performed in a clone of the git tree (my comments are
prefixed by "osv>"):
$ git status
# On branch master
nothing to commit (working directory clean)
$ mv gitweb ../ && ln -s ../gitweb .
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# gitweb
nothing added to commit but untracked files present (use "git add" to track)
osv> here GIT is slightly confused by the change of a directory to a
osv> symlink to a directory.
$ echo hehe >> gitweb/INSTALL
$ git status
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
#
# modified: gitweb/INSTALL
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# gitweb
no changes added to commit (use "git add" and/or "git commit -a")
osv> here confusion is more obvious as GIT reports modified file in an
osv> untracked directory.
$ git commit -a
Created commit 7470207: The commit
1 files changed, 1 insertions(+), 0 deletions(-)
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# gitweb
nothing added to commit but untracked files present (use "git add" to track)
osv> surprisingly nothing very bad happened, -- GIT has commited the
osv> modified file just fine, and left the symlink unchanged.
$ git reset --hard HEAD^
HEAD is now at 7a4a2e1... Set OLD_ICONV on Cygwin.
[osv@fulcrum git]$ git status
# On branch master
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
#
# deleted: gitweb/README
# deleted: gitweb/git-favicon.png
# deleted: gitweb/git-logo.png
# deleted: gitweb/gitweb.css
# deleted: gitweb/gitweb.perl
# deleted: gitweb/test/Märchen
# deleted: gitweb/test/file with spaces
# deleted: gitweb/test/file+plus+sign
#
no changes added to commit (use "git add" and/or "git commit -a")
osv> Ooops, -- now things begin to be more seriously broken. The result
osv> is that GIT removed the symlink, created gitweb directory, and put
osv> only INSTALL file into it. The directory the symlink was pointing
osv> to has the rest of files but INSTALL.
$ git reset --hard HEAD
HEAD is now at 7a4a2e1... Set OLD_ICONV on Cygwin.
$ git status
# On branch master
nothing to commit (working directory clean)
osv> This is now as expected, -- GIT just re-populated the gitweb
osv> directory as there is no symlink anymore.
--
Sergei.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox