* git-gui PATCH Keep repo_config(gui.recentrepos) and .gitconfig in synch
From: Christopher Beelby @ 2010-01-23 19:21 UTC (permalink / raw)
To: git
In-Reply-To: <564f37c41001231118m3f253259g8876ac4fb2b927c2@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1350 bytes --]
This patch addresses two issues:
1. When the number of recent repo's gets to ten there can be a
situation where an item is removed from the .gitconfig file via
a call to git config --unset, but the internal representation of
that file (repo_config(gui.recentrepo)) is not updated. Then a
subsequent attempt to remove an item from the list fails because
git-gui attempts to call --unset on a value that has already been
removed. This leads to duplicates in the .gitconfig file, which
then also cause errors if the git-gui tries to --unset them (rather
than using --unset-all. --unset-all is not used because it is not
expected that duplicates should ever be allowed to exist.)
For complete step-by-step instructions on how to cause these situations
in git-gui see my comment on the msysgit project at
http://code.google.com/p/msysgit/issues/detail?id=362&colspec=ID%20Type%20Status%20Priority%20Component%20Owner%20Summary#c9
2. When loading the list of recent repositories (proc _get_recentrepos)
if a repo in the list is not considered a valid git reposoitory
then we should go ahead and remove it so it doesn't take up a slot
in the list (since we limit to 10 items). This will prevent a bunch of
invalid entries in the list (which are not shown) from making valid
entries dissapear off the list even when there are less than ten valid
entries.
[-- Attachment #2: patch1.patch --]
[-- Type: application/octet-stream, Size: 875 bytes --]
diff --git a/git-gui/lib/choose_repository.tcl b/git-gui/lib/choose_repository.tcl
index 633cc57..3f8f303 100644
--- a/git-gui/lib/choose_repository.tcl
+++ b/git-gui/lib/choose_repository.tcl
@@ -235,6 +235,8 @@ proc _get_recentrepos {} {
foreach p [get_config gui.recentrepo] {
if {[_is_git [file join $p .git]]} {
lappend recent $p
+ } else {
+ _unset_recentrepo $p
}
}
return [lsort $recent]
@@ -243,6 +245,7 @@ proc _get_recentrepos {} {
proc _unset_recentrepo {p} {
regsub -all -- {([()\[\]{}\.^$+*?\\])} $p {\\\1} p
git config --global --unset gui.recentrepo "^$p\$"
+ load_config 1
}
proc _append_recentrepos {path} {
@@ -261,6 +264,7 @@ proc _append_recentrepos {path} {
lappend recent $path
git config --global --add gui.recentrepo $path
+ load_config 1
while {[llength $recent] > 10} {
_unset_recentrepo [lindex $recent 0]
^ permalink raw reply related
* Re: [PATCH] Handle double slashes in make_relative_path()
From: Johannes Sixt @ 2010-01-23 19:00 UTC (permalink / raw)
To: Robin Rosenberg; +Cc: Junio C Hamano, Thomas Rast, git, Linus Torvalds
In-Reply-To: <201001231448.42721.robin.rosenberg@dewire.com>
On Samstag, 23. Januar 2010, Robin Rosenberg wrote:
> lördagen den 23 januari 2010 14.09.29 skrev Johannes Sixt:
> > The function returns either the input unmodified, or it strips also at
> > least one directory component, except when base is only "/" (or "//" or
> > "///"...). I said in practice, because on Windows it does not make sense
> > to invoke git with (literally)
> >
> > git --git-dir=//server/share/repo.git --work-tree=/ ...
> >
> > i.e., without a drive prefix before the slash of --work-tree.
>
> Why not? //foo/bar/z is just as valid and useful a path as x:/z.
Fortunately, make_relative_path() does not have the slightest problem
with //foo/bar/z, either as value of abs (the path to make relative) or as
base (the path to strip from abs).
-- Hannes
^ permalink raw reply
* Advice for "pseudo public" repository on a USB key for a single contributer project
From: Maxime Lévesque @ 2010-01-23 18:27 UTC (permalink / raw)
To: git
Hello Gitsers,
I'm a Git newbee, and I have started a project, with a few month's of code
in
a local git repository.
I am the only develloper/contributor to this repo. I have a clone of my
repository
on a USB key, for back up purposes. Once in a while I work on another
machine
where I have cloned a repo from the USB key.
Since there are no servers involved, I have used pull command
to move my 'HEAD' around :
after working on machine1 I do :
commit to machine1Repo
machine1Repo --pull--> USBKeyRepo
when I switch on machine2 I start by bringing it up to date from the key :
machine2Repo <--pull-- USBKeyRepo
and when I'm finished :
commit to machine2Repo
machine1Repo --pull--> USBKeyRepo
So far I have done all of this using the master branch,
and things don'g always go smoothly I sometimes have
conflicts that don't seem logical, since I'm the only
contrbutor, I should never need to do merges.
From what I have read my USBKey repo is like a public repo,
so I have tried using a bare repo, because since I never work
directly on the usb key, the souces on this repo are just
adding unnecessary complexity. So far I had no success,
because the pull command doesn't recognize my bare repo,
it seems that bare repos must me accessed via a daemon process.
I suspect that I'm probably not using Git correctly (or optimally),
which is why I am inquiring here.
Should I be using a dedicated branch
on each machine (as if I were two contributors) ?
Is it wise to use pulls instead of pushes ?
Should I be using a bare repo on my key ?
Any insight would be appreciated.
Thank you all
^ permalink raw reply
* Re: What's cooking in git.git (Jan 2010, #07; Fri, 22)
From: Jens Lehmann @ 2010-01-23 16:37 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vtyudfqju.fsf@alter.siamese.dyndns.org>
Am 23.01.2010 04:28, schrieb Junio C Hamano:
> * jl/submodule-diff (2010-01-18) 4 commits
> (merged to 'next' on 2010-01-20 at 95cb513)
> + Performance optimization for detection of modified submodules
> (merged to 'next' on 2010-01-17 at 525075b)
> + git status: Show uncommitted submodule changes too when enabled
> (merged to 'next' on 2010-01-16 at 0a99e3c)
> + Teach diff that modified submodule directory is dirty
> + Show submodules as modified when they contain a dirty work tree
What about adding the following patch to this series?
Without it i see a performance regression for people who use
"git diff* --ignore-submodules".
A patch that teaches "git diff --submodule" to display if the submodule
contains new untracked and/or modified files is also almost ready. Would
you consider it for inclusion into 1.7.0 too or shall i wait until after
the release?
------8<-----
Subject: [PATCH] git diff: Don't test submodule dirtiness with --ignore-submodules
The diff family suppresses the output of submodule changes when
requested but checks them nonetheless. But since recently submodules
get examined for their dirtiness, which is rather expensive. There is
no need to do that when the --ignore-submodules option is used, as
the gathered information is never used anyway.
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
---
diff-lib.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/diff-lib.c b/diff-lib.c
index ec2e2ac..e896b9c 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -161,7 +161,10 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
continue;
}
- if ((ce_uptodate(ce) && !S_ISGITLINK(ce->ce_mode)) || ce_skip_worktree(ce))
+ if ((ce_uptodate(ce)
+ && (!S_ISGITLINK(ce->ce_mode)
+ || DIFF_OPT_TST(&revs->diffopt, IGNORE_SUBMODULES)))
+ || ce_skip_worktree(ce))
continue;
/* If CE_VALID is set, don't look at workdir for file removal */
@@ -179,6 +182,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
}
changed = ce_match_stat(ce, &st, ce_option);
if (S_ISGITLINK(ce->ce_mode)
+ && !DIFF_OPT_TST(&revs->diffopt, IGNORE_SUBMODULES)
&& (!changed || (revs->diffopt.output_format & DIFF_FORMAT_PATCH))
&& is_submodule_modified(ce->name)) {
changed = 1;
@@ -220,7 +224,7 @@ static int get_stat_data(struct cache_entry *ce,
const unsigned char **sha1p,
unsigned int *modep,
int cached, int match_missing,
- unsigned *dirty_submodule, int output_format)
+ unsigned *dirty_submodule, struct diff_options *diffopt)
{
const unsigned char *sha1 = ce->sha1;
unsigned int mode = ce->ce_mode;
@@ -241,7 +245,8 @@ static int get_stat_data(struct cache_entry *ce,
}
changed = ce_match_stat(ce, &st, 0);
if (S_ISGITLINK(ce->ce_mode)
- && (!changed || (output_format & DIFF_FORMAT_PATCH))
+ && !DIFF_OPT_TST(diffopt, IGNORE_SUBMODULES)
+ && (!changed || (diffopt->output_format & DIFF_FORMAT_PATCH))
&& is_submodule_modified(ce->name)) {
changed = 1;
*dirty_submodule = 1;
@@ -270,7 +275,7 @@ static void show_new_file(struct rev_info *revs,
* the working copy.
*/
if (get_stat_data(new, &sha1, &mode, cached, match_missing,
- &dirty_submodule, revs->diffopt.output_format) < 0)
+ &dirty_submodule, &revs->diffopt) < 0)
return;
diff_index_show_file(revs, "+", new, sha1, mode, dirty_submodule);
@@ -287,7 +292,7 @@ static int show_modified(struct rev_info *revs,
unsigned dirty_submodule = 0;
if (get_stat_data(new, &sha1, &mode, cached, match_missing,
- &dirty_submodule, revs->diffopt.output_format) < 0) {
+ &dirty_submodule, &revs->diffopt) < 0) {
if (report_missing)
diff_index_show_file(revs, "-", old,
old->sha1, old->ce_mode, 0);
--
1.6.6.1.558.g5c480.dirty
^ permalink raw reply related
* Re: [PATCH] Handle double slashes in make_relative_path()
From: Robin Rosenberg @ 2010-01-23 13:48 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Junio C Hamano, Thomas Rast, git, Linus Torvalds
In-Reply-To: <201001231409.30706.j6t@kdbg.org>
lördagen den 23 januari 2010 14.09.29 skrev Johannes Sixt:
> On Samstag, 23. Januar 2010, Robin Rosenberg wrote:
> > It seems this function does something unhealthy when you pass a path of
> > the form //server/share. On windows dropping the double // at the
> > beginning makes it a different path since // is the UNC prefix.
>
> There is no problem in practice.
>
> The function returns either the input unmodified, or it strips also at
> least one directory component, except when base is only "/" (or "//" or
> "///"...). I said in practice, because on Windows it does not make sense
> to invoke git with (literally)
>
> git --git-dir=//server/share/repo.git --work-tree=/ ...
>
> i.e., without a drive prefix before the slash of --work-tree.
Why not? //foo/bar/z is just as valid and useful a path as x:/z.
Defining a drive-letter with msysgit is tricky because I have to find one that
is available and then also restart every msys bash instance to make msys
see it.
-- robin
^ permalink raw reply
* [PATCH 5/5] Makefile: drop dependency on $(wildcard */*.h)
From: Jonathan Nieder @ 2010-01-23 14:45 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
In-Reply-To: <20100123144201.GA11903@progeny.tock>
The files this pulls in are already pulled in by other dependency
rules (some recently added).
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index eb225c6..d6ebc9d 100644
--- a/Makefile
+++ b/Makefile
@@ -1655,7 +1655,7 @@ git-remote-curl$X: remote-curl.o http.o http-walker.o $(GITLIBS)
$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
$(LIB_OBJS) $(BUILTIN_OBJS) $(TEST_OBJS): $(LIB_H)
-$(patsubst git-%$X,%.o,$(PROGRAMS)) git.o: $(LIB_H) $(wildcard */*.h)
+$(patsubst git-%$X,%.o,$(PROGRAMS)) git.o: $(LIB_H)
builtin-branch.o builtin-checkout.o builtin-clone.o builtin-reset.o branch.o: branch.h
builtin-bundle.o bundle.o transport.o: bundle.h
builtin-bisect--helper.o builtin-rev-list.o bisect.o: bisect.h
--
1.6.6.rc2
^ permalink raw reply related
* [PATCH 4/5] Makefile: clean up http-walker.o dependency rules
From: Jonathan Nieder @ 2010-01-23 14:45 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
In-Reply-To: <20100123144201.GA11903@progeny.tock>
http-walker.o depends on http.h twice: once in the rule listing
files that use http.h, and again in the rule explaining how to
build it. Messy.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index 7da52a3..eb225c6 100644
--- a/Makefile
+++ b/Makefile
@@ -1628,7 +1628,7 @@ http.o: http.c GIT-CFLAGS
$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DGIT_USER_AGENT='"git/$(GIT_VERSION)"' $<
ifdef NO_EXPAT
-http-walker.o: http-walker.c http.h GIT-CFLAGS
+http-walker.o: http-walker.c GIT-CFLAGS
$(QUIET_CC)$(CC) -o $*.o -c $(ALL_CFLAGS) -DNO_EXPAT $<
endif
--
1.6.6.rc2
^ permalink raw reply related
* [PATCH 3/5] Makefile: remove wt-status.h from LIB_H
From: Jonathan Nieder @ 2010-01-23 14:44 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
In-Reply-To: <20100123144201.GA11903@progeny.tock>
A list of the few translation units using this header is
half-populated already. Including the dependency on this header
twice (once explicitly, once through LIB_H) makes it difficult to
figure out where future headers should be added to the Makefile.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
I imagine the 'status' output is not used widely enough to consider it
a library header yet, but I could be easily convinced otherwise.
More important is to avoid the confusing double-dependency.
Makefile | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 448d552..7da52a3 100644
--- a/Makefile
+++ b/Makefile
@@ -512,7 +512,6 @@ LIB_H += tree-walk.h
LIB_H += unpack-trees.h
LIB_H += userdiff.h
LIB_H += utf8.h
-LIB_H += wt-status.h
LIB_H += xdiff-interface.h
LIB_H += xdiff/xdiff.h
@@ -1663,7 +1662,7 @@ builtin-bisect--helper.o builtin-rev-list.o bisect.o: bisect.h
builtin-clone.o builtin-fetch-pack.o transport.o: fetch-pack.h
builtin-send-pack.o transport.o: send-pack.h
builtin-log.o builtin-shortlog.o: shortlog.h
-builtin-revert.o wt-status.o: wt-status.h
+builtin-commit.o builtin-revert.o wt-status.o: wt-status.h
builtin-prune.o builtin-reflog.o reachable.o: reachable.h
builtin-tar-tree.o archive-tar.o: tar.h
builtin-pack-objects.o: thread-utils.h
--
1.6.6.rc2
^ permalink raw reply related
* [PATCH 2/5] Makefile: make sure test helpers are rebuilt when headers change
From: Jonathan Nieder @ 2010-01-23 14:44 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
In-Reply-To: <20100123144201.GA11903@progeny.tock>
It is not worth the bother to maintain an up-to-date list of
which headers each test helper uses, so depend on $(LIB_H) to
catch them all.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Verified (a few weeks ago) with 'make CHECK_HEADER_DEPENDENCIES=1'.
Makefile | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/Makefile b/Makefile
index 2a408d7..448d552 100644
--- a/Makefile
+++ b/Makefile
@@ -384,6 +384,18 @@ SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
# Empty...
EXTRA_PROGRAMS =
+TEST_PROGRAMS += test-chmtime$X
+TEST_PROGRAMS += test-ctype$X
+TEST_PROGRAMS += test-date$X
+TEST_PROGRAMS += test-delta$X
+TEST_PROGRAMS += test-dump-cache-tree$X
+TEST_PROGRAMS += test-genrandom$X
+TEST_PROGRAMS += test-match-trees$X
+TEST_PROGRAMS += test-parse-options$X
+TEST_PROGRAMS += test-path-utils$X
+TEST_PROGRAMS += test-sha1$X
+TEST_PROGRAMS += test-sigchain$X
+
# ... and all the rest that could be moved out of bindir to gitexecdir
PROGRAMS += $(EXTRA_PROGRAMS)
PROGRAMS += git-fast-import$X
@@ -695,6 +707,8 @@ BUILTIN_OBJS += builtin-verify-pack.o
BUILTIN_OBJS += builtin-verify-tag.o
BUILTIN_OBJS += builtin-write-tree.o
+TEST_OBJS := $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))
+
GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
EXTLIBS =
@@ -1641,7 +1655,7 @@ git-remote-curl$X: remote-curl.o http.o http-walker.o $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
-$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
+$(LIB_OBJS) $(BUILTIN_OBJS) $(TEST_OBJS): $(LIB_H)
$(patsubst git-%$X,%.o,$(PROGRAMS)) git.o: $(LIB_H) $(wildcard */*.h)
builtin-branch.o builtin-checkout.o builtin-clone.o builtin-reset.o branch.o: branch.h
builtin-bundle.o bundle.o transport.o: bundle.h
@@ -1732,18 +1746,6 @@ endif
### Testing rules
-TEST_PROGRAMS += test-chmtime$X
-TEST_PROGRAMS += test-ctype$X
-TEST_PROGRAMS += test-date$X
-TEST_PROGRAMS += test-delta$X
-TEST_PROGRAMS += test-dump-cache-tree$X
-TEST_PROGRAMS += test-genrandom$X
-TEST_PROGRAMS += test-match-trees$X
-TEST_PROGRAMS += test-parse-options$X
-TEST_PROGRAMS += test-path-utils$X
-TEST_PROGRAMS += test-sha1$X
-TEST_PROGRAMS += test-sigchain$X
-
all:: $(TEST_PROGRAMS)
# GNU make supports exporting all variables by "export" without parameters.
@@ -1763,9 +1765,7 @@ test-delta$X: diff-delta.o patch-delta.o
test-parse-options$X: parse-options.o
-test-parse-options.o: parse-options.h
-
-.PRECIOUS: $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))
+.PRECIOUS: $(TEST_OBJS)
test-%$X: test-%.o $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
--
1.6.6.rc2
^ permalink raw reply related
* [PATCH 1/5] Makefile: add missing header file dependencies
From: Jonathan Nieder @ 2010-01-23 14:43 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
In-Reply-To: <20100123144201.GA11903@progeny.tock>
LIB_H is missing exec_cmd.h and color.h. cache.h includes
SHA1_HEADER, and thus so does almost everything else, so add that
to LIB_H, too. xdiff-interface.h is not included by any header
files, but so many source files use xdiff that it is simplest to
include it in LIB_H, too.
xdiff-interface.o uses the xdiff library heavily; let it depend
on all xdiff headers to avoid needing to keep track of which
headers it uses.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Makefile | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/Makefile b/Makefile
index fd7f51e..2a408d7 100644
--- a/Makefile
+++ b/Makefile
@@ -447,6 +447,7 @@ LIB_H += blob.h
LIB_H += builtin.h
LIB_H += cache.h
LIB_H += cache-tree.h
+LIB_H += color.h
LIB_H += commit.h
LIB_H += compat/bswap.h
LIB_H += compat/cygwin.h
@@ -457,6 +458,7 @@ LIB_H += delta.h
LIB_H += diffcore.h
LIB_H += diff.h
LIB_H += dir.h
+LIB_H += exec_cmd.h
LIB_H += fsck.h
LIB_H += git-compat-util.h
LIB_H += graph.h
@@ -499,6 +501,8 @@ LIB_H += unpack-trees.h
LIB_H += userdiff.h
LIB_H += utf8.h
LIB_H += wt-status.h
+LIB_H += xdiff-interface.h
+LIB_H += xdiff/xdiff.h
LIB_OBJS += abspath.o
LIB_OBJS += advice.o
@@ -1281,10 +1285,12 @@ endif
ifdef BLK_SHA1
SHA1_HEADER = "block-sha1/sha1.h"
LIB_OBJS += block-sha1/sha1.o
+ LIB_H += block-sha1/sha1.h
else
ifdef PPC_SHA1
SHA1_HEADER = "ppc/sha1.h"
LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
+ LIB_H += ppc/sha1.h
else
SHA1_HEADER = <openssl/sha.h>
EXTLIBS += $(LIB_4_CRYPTO)
@@ -1637,14 +1643,25 @@ git-remote-curl$X: remote-curl.o http.o http-walker.o $(GITLIBS)
$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
$(patsubst git-%$X,%.o,$(PROGRAMS)) git.o: $(LIB_H) $(wildcard */*.h)
+builtin-branch.o builtin-checkout.o builtin-clone.o builtin-reset.o branch.o: branch.h
+builtin-bundle.o bundle.o transport.o: bundle.h
+builtin-bisect--helper.o builtin-rev-list.o bisect.o: bisect.h
+builtin-clone.o builtin-fetch-pack.o transport.o: fetch-pack.h
+builtin-send-pack.o transport.o: send-pack.h
+builtin-log.o builtin-shortlog.o: shortlog.h
builtin-revert.o wt-status.o: wt-status.h
+builtin-prune.o builtin-reflog.o reachable.o: reachable.h
+builtin-tar-tree.o archive-tar.o: tar.h
+builtin-pack-objects.o: thread-utils.h
+http-fetch.o http-walker.o remote-curl.o transport.o walker.o: walker.h
$(LIB_FILE): $(LIB_OBJS)
$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS)
XDIFF_OBJS=xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \
xdiff/xmerge.o xdiff/xpatience.o
-$(XDIFF_OBJS): xdiff/xinclude.h xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \
+xdiff-interface.o $(XDIFF_OBJS): xdiff/xinclude.h \
+ xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \
xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h xdiff/xemit.h
$(XDIFF_LIB): $(XDIFF_OBJS)
--
1.6.6.rc2
^ permalink raw reply related
* [PATCH 0/5] Makefile: add missing header dependency rules
From: Jonathan Nieder @ 2010-01-23 14:42 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
Hi,
As a side-effect of generating dependency rules during the build
locally, it is possible to sanity-check the existing hard-coded
header file dependencies. [1] Now the original topic of that thread [2]
can be addressed without collateral damage.
That is what patches 1 and 2 do. The remaining patches are small
clean-ups that decrease the amount of dependencies again.
These patches are independent of the jn/makefile topic. I sent them
before, but I screwed up the sender so nobody received them. Anyway,
perhaps they could be useful.
Jonathan Nieder (5):
Makefile: add missing header file dependencies
Makefile: make sure test helpers are rebuilt when headers change
Makefile: remove wt-status.h from LIB_H
Makefile: clean up http-walker.o dependency rules
Makefile: drop */*.h dependency rule
Makefile | 58 +++++++++++++++++++++++++++++++++++++---------------------
1 files changed, 37 insertions(+), 21 deletions(-)
[1] http://thread.gmane.org/gmane.comp.version-control.git/133872/focus=136257
[2] http://thread.gmane.org/gmane.comp.version-control.git/133872/focus=133884
^ permalink raw reply
* Re: [PATCH] If deriving SVN_SSH from GIT_SSH on msys, also add quotes
From: Sebastian Schuberth @ 2010-01-23 14:20 UTC (permalink / raw)
To: Sverre Rabbelier; +Cc: git, Johannes Schindelin, jugg
In-Reply-To: <fabb9a1e1001230322t708756fahce326511d3f0bda5@mail.gmail.com>
In contrast to GIT_SSH, SVN_SSH requires quotes for paths that contain
spaces. As GIT_SSH will not work if it contains quotes, it is safe to
assume it never contains quotes. Also, adding quotes to SVN_SSH for paths
that do not contain spaces does no harm. So we always add quotes when
deriving SVN_SSH from GIT_SSH.
This fixes msysGit issue 385, see
http://code.google.com/p/msysgit/issues/detail?id=385
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
---
git-svn.perl | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 650c9e5..ef39a9f 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -26,6 +26,7 @@ if (! exists $ENV{SVN_SSH}) {
$ENV{SVN_SSH} = $ENV{GIT_SSH};
if ($^O eq 'msys') {
$ENV{SVN_SSH} =~ s/\\/\\\\/g;
+ $ENV{SVN_SSH} =~ s/(.*)/"$1"/;
}
}
}
--
1.6.6.265.ga0f40
^ permalink raw reply related
* Re: [PATCH] Handle double slashes in make_relative_path()
From: Johannes Sixt @ 2010-01-23 13:09 UTC (permalink / raw)
To: Robin Rosenberg; +Cc: Junio C Hamano, Thomas Rast, git, Linus Torvalds
In-Reply-To: <201001231240.28138.robin.rosenberg@dewire.com>
On Samstag, 23. Januar 2010, Robin Rosenberg wrote:
> It seems this function does something unhealthy when you pass a path of the
> form //server/share. On windows dropping the double // at the beginning
> makes it a different path since // is the UNC prefix.
There is no problem in practice.
The function returns either the input unmodified, or it strips also at least
one directory component, except when base is only "/" (or "//" or "///"...).
I said in practice, because on Windows it does not make sense to invoke git
with (literally)
git --git-dir=//server/share/repo.git --work-tree=/ ...
i.e., without a drive prefix before the slash of --work-tree.
-- Hannes
^ permalink raw reply
* Re: [PATCH] Handle double slashes in make_relative_path()
From: Robin Rosenberg @ 2010-01-23 11:40 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Junio C Hamano, Thomas Rast, git, Linus Torvalds
In-Reply-To: <4B59637D.4090503@viscovery.net>
fredagen den 22 januari 2010 09.36.13 skrev Johannes Sixt:
> Junio C Hamano schrieb:
> > Credit for test script, motivation and initial patch goes to Thomas Rast,
> > but the bugs in the implementation of this patch are mine..
>
> And with this squashed in it has fewer of them ;-) and is more portable.
> The bug was that /foo was incorrectly stripped from /foobar.
It seems this function does something unhealthy when you pass a path of the
form //server/share. On windows dropping the double // at the beginning makes
it a different path since // is the UNC prefix.
I'm not sure git on windows actually works with UNC-prefix anyway, so my point
may be moot, but having even more places to fix to make it work doesn't help.
-- robin
^ permalink raw reply
* Re: [PATCH 0/2] two git-svn changes to help work with chromium.org
From: Eric Wong @ 2010-01-23 11:26 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Jay Soffian, Andrew Myrick
In-Reply-To: <1264235401-44051-1-git-send-email-jaysoffian@gmail.com>
Jay Soffian <jaysoffian@gmail.com> wrote:
> Google nicely mirrors the subversion chrome repository with git-svn. However,
> the git-svn mirror has only trunk. I wanted to add in a couple other branches
> to my clone of the git-svn mirror, but to do so I needed the ability to lie
> about the UUID since the publically accessible subversion repository has a
> different UUID than that which google is cloning from using git-svn.
Thanks Jay, pushed out to git://git.bogomips.org/git-svn
along with a few other changes I've been forgetting about:
> Jay Soffian (2):
> git-svn: allow UUID to be manually remapped via rewriteUUID
> git-svn: allow subset of branches/tags to be specified in glob spec
Andrew Myrick (3):
git-svn: ignore changeless commits when checking for a cherry-pick
git-svn: handle merge-base failures
git-svn: update svn mergeinfo test suite
Igor Mironov (4):
git-svn: fix mismatched src/dst errors for branch/tag
git-svn: respect commiturl option for branch/tag
git-svn: add --username/commit-url options for branch/tag
git-svn: document --username/commit-url for branch/tag
--
Eric Wong
^ permalink raw reply
* Re: [PATCH] If deriving SVN_SSH from GIT_SSH on msys, also add quotes
From: Sverre Rabbelier @ 2010-01-23 11:22 UTC (permalink / raw)
To: Sebastian Schuberth; +Cc: git, Johannes Schindelin, jugg
In-Reply-To: <4B5ACDD5.8080007@gmail.com>
Heya,
On Sat, Jan 23, 2010 at 11:22, Sebastian Schuberth <sschuberth@gmail.com> wrote:
> spaces. As GIT_SSH will not work if it contains quotes, it is save to
s/save/safe/
--
Cheers,
Sverre Rabbelier
^ permalink raw reply
* Re: What's cooking in git.git (Jan 2010, #07; Fri, 22)
From: Jakub Narebski @ 2010-01-23 11:18 UTC (permalink / raw)
To: Junio C Hamano
Cc: git, John 'Warthog9' Hawley,
John 'Warthog9' Hawley
In-Reply-To: <7vtyudfqju.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> * jh/gitweb-cached (2010-01-13) 9 commits
> - gitweb: File based caching layer (from git.kernel.org)
> - gitweb: Convert output to using indirect file handle
> - gitweb: cleanup error message produced by undefined $site_header
> - gitweb: add a get function to compliment print_sort_th
> - gitweb: add a get function to compliment print_local_time
> - gitweb: Makefile improvements
> - gitweb: Add option to force version match
> - gitweb: change die_error to take "extra" argument for extended die information
> - gitweb: Load checking
>
> Replaced with a re-roll. Update to t9500 is probably needed.
I have sent proof of concept replacements for the last two
patches... and those do include update to t9500 (although caching is
tested only rudimentally).
I don't know if J.H. is working on replacement patches; I am planning
on re-rolling cleaned up version of split file based caching layer on
top of his changes / his re-roll.
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: cherry picking several patches at once
From: Sverre Rabbelier @ 2010-01-23 11:17 UTC (permalink / raw)
To: Marc Weber; +Cc: git
In-Reply-To: <1264205767-sup-4547@nixos>
Heya,
On Sat, Jan 23, 2010 at 01:24, Marc Weber <marco-oweber@gmx.de> wrote:
> git cherry-push-checkout-on-failure hash other-branch
Heh, I could use that exact command myself, as I use the exact
workflow you described :).
--
Cheers,
Sverre Rabbelier
^ permalink raw reply
* Re: [PATCH 5/9] gitweb: add a get function to compliment print_local_time
From: Jakub Narebski @ 2010-01-23 11:13 UTC (permalink / raw)
To: John 'Warthog9' Hawley; +Cc: git
In-Reply-To: <1263432185-21334-6-git-send-email-warthog9@eaglescrag.net>
"John 'Warthog9' Hawley" <warthog9@eaglescrag.net> writes:
Should authorship be associated with eaglescrag.net or kernel.org?
> This adds a get function for print_local_time so that the basic
> function can be used outside of their straight printing operation.
Signoff?
> ---
> gitweb/gitweb.perl | 11 +++++++++--
> 1 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index b41bc33..d38aad6 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -3537,14 +3537,21 @@ sub git_print_header_div {
> }
>
> sub print_local_time {
> + print get_local_time(@_);
> +}
> +
> +sub get_local_time {
This new function should be rather named 'format_local_time', to
follow gitweb convention of naming subroutines. (And of course commit
message needs to be changed accordingly.)
This comment applies also to the following patch.
> + my $localtime = "";
> my %date = @_;
> if ($date{'hour_local'} < 6) {
> - printf(" (<span class=\"atnight\">%02d:%02d</span> %s)",
> + $localtime .= sprintf(" (<span class=\"atnight\">%02d:%02d</span> %s)",
> $date{'hour_local'}, $date{'minute_local'}, $date{'tz_local'});
> } else {
> - printf(" (%02d:%02d %s)",
> + $localtime .= sprintf(" (%02d:%02d %s)",
> $date{'hour_local'}, $date{'minute_local'}, $date{'tz_local'});
> }
> +
> + return $localtime
Style (terminate statement with ';'):
+ return $localtime;
> }
>
> # Outputs the author name and date in long form
> --
> 1.6.5.2
>
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply
* [PATCH] If deriving SVN_SSH from GIT_SSH on msys, also add quotes
From: Sebastian Schuberth @ 2010-01-23 10:22 UTC (permalink / raw)
To: git; +Cc: Johannes Schindelin, jugg
In contrast to GIT_SSH, SVN_SSH requires quotes for paths that contain
spaces. As GIT_SSH will not work if it contains quotes, it is save to
assume it never contains quotes. Also, adding quotes to SVN_SSH for paths
that do not contain spaces does no harm. So we always add quotes when
deriving SVN_SSH from GIT_SSH on msys.
This fixes msysGit issue 385, see
http://code.google.com/p/msysgit/issues/detail?id=385
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
---
git-svn.perl | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 650c9e5..ef39a9f 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -26,6 +26,7 @@ if (! exists $ENV{SVN_SSH}) {
$ENV{SVN_SSH} = $ENV{GIT_SSH};
if ($^O eq 'msys') {
$ENV{SVN_SSH} =~ s/\\/\\\\/g;
+ $ENV{SVN_SSH} =~ s/(.*)/"$1"/;
}
}
}
--
1.6.6.265.ga0f40
^ permalink raw reply related
* [PATCHv4 5/5] git-gui: update shortcut tools to use _gitworktree
From: Giuseppe Bilotta @ 2010-01-23 10:03 UTC (permalink / raw)
To: git; +Cc: Shawn O. Pearce, Markus Heidelberg, Giuseppe Bilotta
In-Reply-To: <1264241018-6616-1-git-send-email-giuseppe.bilotta@gmail.com>
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
---
git-gui/lib/shortcut.tcl | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/git-gui/lib/shortcut.tcl b/git-gui/lib/shortcut.tcl
index 2f20eb3..79c1888 100644
--- a/git-gui/lib/shortcut.tcl
+++ b/git-gui/lib/shortcut.tcl
@@ -2,6 +2,7 @@
# Copyright (C) 2006, 2007 Shawn Pearce
proc do_windows_shortcut {} {
+ global _gitworktree
set fn [tk_getSaveFile \
-parent . \
-title [append "[appname] ([reponame]): " [mc "Create Desktop Icon"]] \
@@ -15,7 +16,7 @@ proc do_windows_shortcut {} {
[info nameofexecutable] \
[file normalize $::argv0] \
] \
- [file dirname [file normalize [gitdir]]]
+ [file normalize [$_gitworktree]]
} err]} {
error_popup [strcat [mc "Cannot write shortcut:"] "\n\n$err"]
}
@@ -23,7 +24,7 @@ proc do_windows_shortcut {} {
}
proc do_cygwin_shortcut {} {
- global argv0
+ global argv0 _gitworktree
if {[catch {
set desktop [exec cygpath \
@@ -56,7 +57,7 @@ proc do_cygwin_shortcut {} {
$sh -c \
"CHERE_INVOKING=1 source /etc/profile;[sq $me] &" \
] \
- [file dirname [file normalize [gitdir]]]
+ [file normalize [$_gitworktree]]
} err]} {
error_popup [strcat [mc "Cannot write shortcut:"] "\n\n$err"]
}
--
1.6.6.rc1.295.g3a4e71
^ permalink raw reply related
* [PATCHv4 4/5] git-gui: set GIT_DIR and GIT_WORK_TREE after setup
From: Giuseppe Bilotta @ 2010-01-23 10:03 UTC (permalink / raw)
To: git; +Cc: Shawn O. Pearce, Markus Heidelberg, Giuseppe Bilotta
In-Reply-To: <1264241018-6616-1-git-send-email-giuseppe.bilotta@gmail.com>
Rather than juggling $GIT_DIR around the invocation of gitk, set it
(and $GIT_WORK_TREE) after finishing setup, ensuring that any external
tool works with the setup we're running with.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
---
git-gui/git-gui.sh | 15 +++------------
1 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index c5c787d..aff0644 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -1171,6 +1171,9 @@ if {[lindex $_reponame end] eq {.git}} {
set _reponame [lindex $_reponame end]
}
+set env(GIT_DIR) $_gitdir
+set env(GIT_WORK_TREE) $_gitworktree
+
######################################################################
##
## global init
@@ -1986,25 +1989,13 @@ proc do_gitk {revs} {
} else {
global env
- if {[info exists env(GIT_DIR)]} {
- set old_GIT_DIR $env(GIT_DIR)
- } else {
- set old_GIT_DIR {}
- }
-
set pwd [pwd]
if { ![is_bare] } {
cd $_gitworktree
}
- set env(GIT_DIR) [file normalize [gitdir]]
eval exec $cmd $revs &
- if {$old_GIT_DIR eq {}} {
- unset env(GIT_DIR)
- } else {
- set env(GIT_DIR) $old_GIT_DIR
- }
cd $pwd
ui_status $::starting_gitk_msg
--
1.6.6.rc1.295.g3a4e71
^ permalink raw reply related
* [PATCHv4 2/5] git-gui: handle bare repos correctly
From: Giuseppe Bilotta @ 2010-01-23 10:03 UTC (permalink / raw)
To: git; +Cc: Shawn O. Pearce, Markus Heidelberg, Giuseppe Bilotta
In-Reply-To: <1264241018-6616-1-git-send-email-giuseppe.bilotta@gmail.com>
Refactor checking for a bare repository into its own proc, that relies
on git rev-parse --is-bare-repository if possible. For older versions of
git we fall back to a logic such that the repository is considered bare
if:
* either the core.bare setting is true
* or the worktree is not set and the directory name ends with .git
The error message for the case of an unhandled bare repository is also
updated to reflect the fact that the problem is not the funny name but
the bareness.
The new refactored proc is also used to disable the menu entry to
explore the working copy, and to skip changing to the worktree before
the gitk invocation.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
---
git-gui/git-gui.sh | 43 ++++++++++++++++++++++++++++++++++++-------
1 files changed, 36 insertions(+), 7 deletions(-)
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 7e633f4..d0dff40 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -122,6 +122,7 @@ unset oguimsg
set _appname {Git Gui}
set _gitdir {}
set _gitworktree {}
+set _isbare {}
set _gitexec {}
set _githtmldir {}
set _reponame {}
@@ -277,6 +278,32 @@ proc get_config {name} {
}
}
+proc is_bare {} {
+ global _isbare
+ global _gitdir
+ global _gitworktree
+
+ if {$_isbare eq {}} {
+ if {[catch {
+ set _bare [git rev-parse --is-bare-repository]
+ switch -- $_bare {
+ true { set _isbare 1 }
+ false { set _isbare 0}
+ default { throw }
+ }
+ }]} {
+ if {[is_config_true core.bare]
+ || ($_gitworktree eq {}
+ && [lindex [file split $_gitdir] end] ne {.git})} {
+ set _isbare 1
+ } else {
+ set _isbare 0
+ }
+ }
+ }
+ return $_isbare
+}
+
######################################################################
##
## handy utils
@@ -1112,9 +1139,9 @@ if {$_prefix ne {}} {
set _gitworktree [pwd]
unset cdup
} elseif {![is_enabled bare]} {
- if {[lindex [file split $_gitdir] end] ne {.git}} {
+ if {[is_bare]} {
catch {wm withdraw .}
- error_popup [strcat [mc "Cannot use funny .git directory:"] "\n\n$_gitdir"]
+ error_popup [strcat [mc "Cannot use bare repository:"] "\n\n$_gitdir"]
exit 1
}
if {$_gitworktree eq {}} {
@@ -1956,7 +1983,7 @@ proc do_gitk {revs} {
}
set pwd [pwd]
- if { $_gitworktree ne {} } {
+ if { ![is_bare] } {
cd $_gitworktree
}
set env(GIT_DIR) [file normalize [gitdir]]
@@ -2383,10 +2410,12 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
#
menu .mbar.repository
-.mbar.repository add command \
- -label [mc "Explore Working Copy"] \
- -command {do_explore}
-.mbar.repository add separator
+if {![is_bare]} {
+ .mbar.repository add command \
+ -label [mc "Explore Working Copy"] \
+ -command {do_explore}
+ .mbar.repository add separator
+}
.mbar.repository add command \
-label [mc "Browse Current Branch's Files"] \
--
1.6.6.rc1.295.g3a4e71
^ permalink raw reply related
* [PATCHv4 3/5] git-gui: work from the .git dir
From: Giuseppe Bilotta @ 2010-01-23 10:03 UTC (permalink / raw)
To: git; +Cc: Shawn O. Pearce, Markus Heidelberg, Giuseppe Bilotta
In-Reply-To: <1264241018-6616-1-git-send-email-giuseppe.bilotta@gmail.com>
When git-gui is run from a .git dir, _gitdir would be set to "." by
rev-parse, something that confuses the worktree detection.
Fix by expanding the value of _gitdir to pwd in this special case.
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
---
git-gui/git-gui.sh | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index d0dff40..c5c787d 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -1102,6 +1102,8 @@ if {[catch {
set _prefix {}
}]
&& [catch {
+ # beware that from the .git dir this sets _gitdir to .
+ # and _prefix to the empty string
set _gitdir [git rev-parse --git-dir]
set _prefix [git rev-parse --show-prefix]
} err]} {
@@ -1110,6 +1112,14 @@ if {[catch {
choose_repository::pick
set picked 1
}
+
+# we expand the _gitdir when it's just a single dot (i.e. when we're being
+# run from the .git dir itself) lest the routines to find the worktree
+# get confused
+if {$_gitdir eq "."} {
+ set _gitdir [pwd]
+}
+
if {![file isdirectory $_gitdir] && [is_Cygwin]} {
catch {set _gitdir [exec cygpath --windows $_gitdir]}
}
--
1.6.6.rc1.295.g3a4e71
^ permalink raw reply related
* [PATCHv4 0/5] git-gui: more robust handling of fancy repos
From: Giuseppe Bilotta @ 2010-01-23 10:03 UTC (permalink / raw)
To: git; +Cc: Shawn O. Pearce, Markus Heidelberg, Giuseppe Bilotta
A re-issue of the patchest to make git-gui more robust towards
non-standard repository setup, with two additional fixes.
The first three patches are unchanged from the previous iteration (still
waiting for review, actually).
The 4th sets GIT_DIR and GIT_WORK_TREE in git-gui to ensure that all
external tool invocation work in the same setup.
The last one also updates the shortcut library to make use of
_gitworktree instead of the old assumption that the worktree is the
updir of the git dir. I can't really test this patch though because
I don't have Windows.
Giuseppe Bilotta (5):
git-gui: handle non-standard worktree locations
git-gui: handle bare repos correctly
git-gui: work from the .git dir
git-gui: set GIT_DIR and GIT_WORK_TREE after setup
git-gui: update shortcut tools to use _gitworktree
git-gui/git-gui.sh | 101 ++++++++++++++++++++++++++++++++++------------
git-gui/lib/shortcut.tcl | 7 ++-
2 files changed, 79 insertions(+), 29 deletions(-)
^ 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