* Re: do without .netrc
From: Miklos Vajna @ 2008-08-06 10:50 UTC (permalink / raw)
To: Michael J Gruber; +Cc: git
In-Reply-To: <g7bq85$otb$1@ger.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 466 bytes --]
On Wed, Aug 06, 2008 at 11:17:48AM +0200, Michael J Gruber <michaeljgruber+gmane@fastmail.fm> wrote:
> Not having the password on disk[?!]
I think you can't avoid so (we are talking about http).
There is no such thing as ssh-agent for http, and typing the password
for each pull or push is boring. (OK, this is subjective, but I think
nobody types his/her pass on every push/pull.)
You could have the password in the URL, but the it's in .git/config,
even worse.
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: something fishy with Git commit and log from file
From: Luciano Rocha @ 2008-08-06 10:44 UTC (permalink / raw)
To: Pascal Obry; +Cc: git list
In-Reply-To: <48997D2E.9030708@obry.net>
[-- Attachment #1: Type: text/plain, Size: 1333 bytes --]
On Wed, Aug 06, 2008 at 12:30:06PM +0200, Pascal Obry wrote:
>
> The following command fails on my repository:
>
> $ git commit --file=clog
> fatal: could not read log file 'clog': No such file or directory
>
> $ cat clog
> toto
>
> Using the following command the commit pass without problem:
>
> $ cat clog | git commit --file=-
>
> With GDB I get:
>
> $ gdb --args git ci --file=clog
> This GDB was configured as "i686-pc-cygwin"...
> (gdb) break strbuf_read_file
> Breakpoint 1 at 0x44e64a: file strbuf.c, line 301.
> (gdb) run
> Starting program: /usr/local/bin/git.exe ci --file=clog
>
> Breakpoint 1, strbuf_read_file (sb=0x22cac0, path=0x22ccfa "clog", hint=0)
> at strbuf.c:301
> 301 fd = open(path, O_RDONLY);
> (gdb) print path
> $1 = 0x0
>
> ???? outch, this is strange, or a gdb artifact?
gdb artifact. The breakpoint info shows the correct value.
Could you at that point run the following?
(gdb) p get_current_dir_name()
$1 = ... "..."
If the returned value doesn't match the directory you were in, then
there's a bug in git.
If the function doesn't exist, try:
(gdb) p getwd(malloc(2048))
Regards,
Luciano Rocha
--
Luciano Rocha <luciano@eurotux.com>
Eurotux Informática, S.A. <http://www.eurotux.com/>
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* something fishy with Git commit and log from file
From: Pascal Obry @ 2008-08-06 10:30 UTC (permalink / raw)
To: git list
The following command fails on my repository:
$ git commit --file=clog
fatal: could not read log file 'clog': No such file or directory
$ cat clog
toto
Using the following command the commit pass without problem:
$ cat clog | git commit --file=-
With GDB I get:
$ gdb --args git ci --file=clog
This GDB was configured as "i686-pc-cygwin"...
(gdb) break strbuf_read_file
Breakpoint 1 at 0x44e64a: file strbuf.c, line 301.
(gdb) run
Starting program: /usr/local/bin/git.exe ci --file=clog
Breakpoint 1, strbuf_read_file (sb=0x22cac0, path=0x22ccfa "clog",
hint=0) at strbuf.c:301
301 fd = open(path, O_RDONLY);
(gdb) print path
$1 = 0x0
???? outch, this is strange, or a gdb artifact?
(gdb) n
302 if (fd < 0)
(gdb) print fd
$2 = -1
(gdb) print *0x22ccfa
$3 = 1735355491
(gdb) print (char)*0x22ccfa
$4 = 99 'c'
(gdb) print (char)*0x22ccfb
$5 = 108 'l'
(gdb) print (char)*0x22ccfc
$6 = 111 'o'
(gdb) print (char)*0x22ccfd
$7 = 103 'g'
(gdb) print (char)*0x22ccfe
$8 = 0 '\0'
But looks like path really contains 'clog'!!!
No luck for now to find the problem. Note that the same command pass
fine on other repositories. At this point this looks really like some
kind of memory corruption...
I'm on Windows, using Git for Cygwin and the compiler is:
$ gcc --version
gcc (GCC) 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
Pascal.
--
--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
^ permalink raw reply
* Re: StGit: kha/{stable,safe,experimental} updated
From: Karl Hasselström @ 2008-08-06 10:18 UTC (permalink / raw)
To: Catalin Marinas; +Cc: git, Samuel Tardieu
In-Reply-To: <b0943d9e0808051433i667f6a05iff1a5220e37602e7@mail.gmail.com>
On 2008-08-05 22:33:57 +0100, Catalin Marinas wrote:
> 2008/8/1 Karl Hasselström <kha@treskal.com>:
>
> > Heh. It's _always_ your main worry. But rightly so, since mistakes
> > could be costly. Thanks for spending time on this with me.
>
> I'm usually worried about performance but will give it a try with a
> Linux kernel and real patches. Have you done any tests to compare it
> with my master branch?
Yes. I posted the benchmark results a while back -- as I recall, the
performance was about the same for large uncommit and rebase
operations.
Also, I'm currently investigating some possible optimizations. Will
post new bechmarks afterwards, if I get something working.
> Would we even need to prune the stack history? It might get pretty
> large after about 1-2 years of usage.
Yes, it's growing without bound, so eventually one would have to prune
it.
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle
^ permalink raw reply
* Re: [PATCH] fix diff-tree --stdin documentation
From: Karl Hasselström @ 2008-08-06 10:04 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7v7iauu2s3.fsf_-_@gitster.siamese.dyndns.org>
On 2008-08-05 22:32:28 -0700, Junio C Hamano wrote:
> - reads either one <commit> or a pair of <tree-ish>
> + reads either one <commit> or a list of <commit>
Thanks. Didn't quite solve my problem though, since diffing trees was
what I wanted to use diff-tree for. :-/ But I think I can rephrase my
problem so that I give it a commit instead.
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle
^ permalink raw reply
* Re: [StGit] stg import documentation incorrect.
From: Karl Hasselström @ 2008-08-06 9:51 UTC (permalink / raw)
To: Catalin Marinas; +Cc: Jurko Gospodneti?, git
In-Reply-To: <b0943d9e0808051407k3ae902cbma9b5bef8b0219c05@mail.gmail.com>
On 2008-08-05 22:07:01 +0100, Catalin Marinas wrote:
> 2008/8/4 Karl Hasselström <kha@treskal.com>:
>
> > Yes, the tutorial is in sore need of a fresh coat of paint.
>
> Now that you mentioned it, should we just replace the wiki tutorial
> by a static page generated from Documentation/tutorial.txt?
Yes. That way it could get updated along with the rest of StGit.
> If no-one feels like writing documentation, I'll have a go at
> updating the tutorial.
Please do. I'm always just about to do something about the
documentation, but there's always something else that's in front of it
in my pipeline ...
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle
^ permalink raw reply
* RE: Query: GIT bare repro
From: Pandita, Vikram @ 2008-08-06 9:15 UTC (permalink / raw)
To: Christian MICHON; +Cc: git@vger.kernel.org
In-Reply-To: <46d6db660808060129u754488d3jda27e3873154c533@mail.gmail.com>
> From: Christian MICHON [mailto:christian.michon@gmail.com]
> Sent: Wednesday, August 06, 2008 1:59 PM
>
> On Wed, Aug 6, 2008 at 9:46 AM, Pandita, Vikram <vikram.pandita@ti.com> wrote:
> > Hi GIT users
> >
> > I want to use GIT for my team for distributed development.
> > The team members are working at different sites.
> >
> > Would appreciate help on following:
> >
> > 1) Could you point me to some document/example for doing so? This should be very common scenario I
> assume.
>
> Please read http://book.git-scm.com/3_distributed_workflows.html
Thanks Christian
Sure this will help.
>
> --
> Christian
> --
> http://detaolb.sourceforge.net/, a linux distribution for Qemu with Git inside !
^ permalink raw reply
* Re: do without .netrc
From: Michael J Gruber @ 2008-08-06 9:17 UTC (permalink / raw)
To: git
In-Reply-To: <20080806085025.GU32057@genesis.frugalware.org>
Miklos Vajna venit, vidit, dixit 06.08.2008 10:50:
> On Wed, Aug 06, 2008 at 01:00:54AM +0200, Jürgen Mangler <juergen.mangler@univie.ac.at> wrote:
>> it is working without a:b@ part, but ~/.netrc instead
>>
>> :-(, is it possible without .netrc
>
> I thought questions have question marks. ;-)
>
> Anyway, what is the advantage of not using a ~/.netrc?
Not having the password on disk[?!]
Michael
^ permalink raw reply
* Re: do without .netrc
From: Miklos Vajna @ 2008-08-06 8:50 UTC (permalink / raw)
To: Jürgen Mangler; +Cc: git
In-Reply-To: <4898DBA6.1060707@univie.ac.at>
[-- Attachment #1: Type: text/plain, Size: 301 bytes --]
On Wed, Aug 06, 2008 at 01:00:54AM +0200, Jürgen Mangler <juergen.mangler@univie.ac.at> wrote:
> it is working without a:b@ part, but ~/.netrc instead
>
> :-(, is it possible without .netrc
I thought questions have question marks. ;-)
Anyway, what is the advantage of not using a ~/.netrc?
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: Query: GIT bare repro
From: Christian MICHON @ 2008-08-06 8:29 UTC (permalink / raw)
To: Pandita, Vikram; +Cc: git@vger.kernel.org
In-Reply-To: <FCCFB4CDC6E5564B9182F639FC35608701C2C85A14@dbde02.ent.ti.com>
On Wed, Aug 6, 2008 at 9:46 AM, Pandita, Vikram <vikram.pandita@ti.com> wrote:
> Hi GIT users
>
> I want to use GIT for my team for distributed development.
> The team members are working at different sites.
>
> Would appreciate help on following:
>
> 1) Could you point me to some document/example for doing so? This should be very common scenario I assume.
Please read http://book.git-scm.com/3_distributed_workflows.html
--
Christian
--
http://detaolb.sourceforge.net/, a linux distribution for Qemu with Git inside !
^ permalink raw reply
* [TopGit PATCH] tg.sh: Check for read permissions of help files
From: Bert Wesarg @ 2008-08-06 8:02 UTC (permalink / raw)
To: Petr Baudis; +Cc: Bert Wesarg, git
We currently check only for '-f' but we need to have read permissions as well.
And help files don't need the execution bit set.
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
Makefile | 2 +-
tg.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 238d07d..f9dbe6e 100644
--- a/Makefile
+++ b/Makefile
@@ -35,7 +35,7 @@ install:: all
install -d -m 755 "$(hooksdir)"
install $(hooks_out) "$(hooksdir)"
install -d -m 755 "$(sharedir)"
- install $(help_out) "$(sharedir)"
+ install -m 644 $(help_out) "$(sharedir)"
clean::
rm -f tg $(commands_out) $(hooks_out) $(help_out)
diff --git a/tg.sh b/tg.sh
index 03a392b..edac006 100644
--- a/tg.sh
+++ b/tg.sh
@@ -154,7 +154,7 @@ do_help()
if [ -z "$1" ] ; then
echo "TopGit v0.1 - A different patch queue manager"
echo "Usage: tg (create|delete|info|patch|summary|update|help) ..."
- elif [ -f "@sharedir@/tg-$1.txt" ] ; then
+ elif [ -f "@sharedir@/tg-$1.txt" -a -r "@sharedir@/tg-$1.txt" ] ; then
cat "@sharedir@/tg-$1.txt"
else
echo "`basename $0`: no help for $1" 1>&2
--
tg: (e311d15..) t/check-read-permissions-of-help-files (depends on: master)
^ permalink raw reply related
* Query: GIT bare repro
From: Pandita, Vikram @ 2008-08-06 7:46 UTC (permalink / raw)
To: git@vger.kernel.org
In-Reply-To: <7vfxpislpf.fsf@gitster.siamese.dyndns.org>
Hi GIT users
I want to use GIT for my team for distributed development.
The team members are working at different sites.
Would appreciate help on following:
1) Could you point me to some document/example for doing so? This should be very common scenario I assume.
2) I understand that every developer will need a BARE public repro and a personal repro.
- How does one push new branches to a bare public repro?
- do Public and personal repro need to be on the same machine?
- Can one "PROTECT" specific branches in public repro like master?
One may not want the MASTER of public repro to be overwritten?
Regards,
Vikram
^ permalink raw reply
* [TopGit PATCH] tg.sh: Runtime tg-* command check
From: Bert Wesarg @ 2008-08-06 7:49 UTC (permalink / raw)
To: Petr Baudis; +Cc: Bert Wesarg, git
Check for tg commands at runtime, not the hard coded list inside tg.sh.
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
tg.sh | 26 +++++++++++++++++++++-----
1 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/tg.sh b/tg.sh
index 03a392b..179f0de 100644
--- a/tg.sh
+++ b/tg.sh
@@ -152,8 +152,21 @@ switch_to_base()
do_help()
{
if [ -z "$1" ] ; then
+ ## Build available commands list for help output
+
+ cmds=
+ sep=
+ for cmd in "@cmddir@"/tg-*; do
+ ! [ -r "$cmd" ] && continue
+ # strip directory part and "tg-" prefix
+ cmd="$(basename "$cmd")"
+ cmd="${cmd#tg-}"
+ cmds="$cmds$sep$cmd"
+ sep="|"
+ done
+
echo "TopGit v0.1 - A different patch queue manager"
- echo "Usage: tg (create|delete|info|patch|summary|update|help) ..."
+ echo "Usage: tg ($cmds|help) ..."
elif [ -f "@sharedir@/tg-$1.txt" ] ; then
cat "@sharedir@/tg-$1.txt"
else
@@ -171,6 +184,8 @@ root_dir="$(git rev-parse --show-cdup)"; root_dir="${root_dir:-.}"
setup_ours
setup_hook "pre-commit"
+[ -d "@cmddir@" ] ||
+ die "No command directory: '@cmddir@'"
## Dispatch
@@ -186,12 +201,13 @@ case "$cmd" in
help)
do_help "$1"
exit 1;;
-create|delete|info|patch|summary|update)
- . "@cmddir@"/tg-$cmd;;
--hooks-path)
# Internal command
echo "@hooksdir@";;
*)
- echo "Unknown subcommand: $cmd" >&2
- exit 1;;
+ [ -r "@cmddir@"/tg-$cmd ] || {
+ echo "Unknown subcommand: $cmd" >&2
+ exit 1
+ }
+ . "@cmddir@"/tg-$cmd;;
esac
--
tg: (e311d15..) t/auto-generate-command-list-for-tg.sh (depends on: master)
^ permalink raw reply related
* git problem: pack has bad object at offset 77100841: inflate returned -3
From: srinivas naga vutukuri @ 2008-08-06 7:15 UTC (permalink / raw)
To: git
I am facing the error
remote: Counting objects: 879862, done.
remote: Compressing objects: 100% (156686/156686), done.
fatal: pack has bad object at offset 77100841: inflate returned -3
fatal: index-pack failed
while doing "git clone" of linux kernel of latest 2.6.27-rc2.
But am able to do the latest stable successfully.
Could you help me out in get rid off the problem. And am new to git usage,
so correct me if am doing any wrong.
I am using cygwin, git 1.5.6.4
best regards,
srinivas.
^ permalink raw reply
* What's in git.git (Aug 2008, #01; Tue, 05)
From: Junio C Hamano @ 2008-08-06 6:26 UTC (permalink / raw)
To: git
Thanks to many people, we have accumulated quite a few fixes that are
appropriate for 1.6.0 stabilization effort but at the same time apply
equally well to 1.5.6 series. We might want to do 1.5.6.5 to flush them
while we are at it.
I am planning to tag 1.6.0-rc2 tomorrow evening. I noticed that both gitk
and git-gui have fixes and many updated translations that I intend to
pull before tagging -rc2.
* The 'maint' branch has these fixes since the last announcement.
Anders Melchiorsen (1):
Documentation: fix diff.external example
Brandon Casey (1):
t/t4202-log.sh: add newline at end of file
Ciaran McCreesh (1):
Make git-add -i accept ranges like 7-
Jeff King (1):
init: handle empty "template" parameter
Jim Meyering (1):
git-cvsimport.perl: Print "UNKNOWN LINE..." on stderr, not stdout.
Johannes Schindelin (1):
sort_in_topological_order(): avoid setting a commit flag
Jonathan Nieder (1):
git-diff(1): "--c" -> "--cc" typo fix
Junio C Hamano (6):
make sure parsed wildcard refspec ends with slash
Documentation: clarify diff --cc
Update my e-mail address
Start 1.5.6.5 RelNotes to describe accumulated fixes
builtin-name-rev.c: split deeply nested part from the main function
RelNotes 1.5.6.5 updates
Linus Torvalds (1):
diff.renamelimit is a basic diff configuration
Mike Ralphson (1):
Documentation: typos / spelling fixes in older RelNotes
Pierre Habouzit (1):
git-submodule: move ill placed shift.
Pieter de Bie (1):
git-name-rev: allow --name-only in combination with --stdin
René Scharfe (1):
git-name-rev: don't use printf without format
Stephan Beyer (1):
builtin-revert.c: typofix
Steve Haslam (1):
Propagate -u/--upload-pack option of "git clone" to transport.
* The 'master' branch has these since the last announcement
in addition to the above.
Abhijit Menon-Sen (4):
Git.pm: localise $? in command_close_bidi_pipe()
Fix hash slice syntax error
Fix typo in perl/Git.pm
Fix typos in INSTALL
Anders Melchiorsen (2):
Flush output in start_async
Add output flushing before fork()
Avery Pennarun (2):
Teach "git diff -p" Pascal/Delphi funcname pattern
git-svn: Abort with an error if 'fetch' parameter is invalid.
Brandon Casey (1):
Teach fsck and prune that tmp_obj_ file names may not be 14 bytes long
David D. Kilzer (1):
Fix race condition in t9119-git-svn-info.sh
Dmitry Potapov (1):
correct access right for git-svn-dcommit test
Eric Wong (2):
git-svn: properly set path for "info" command
t9119: conditionally re-enable test depending on svn(1) version
Giuseppe Bilotta (2):
diff: add ruby funcname pattern
diff: chapter and part in funcname for tex
Johannes Schindelin (2):
clone: Add an option to set up a mirror
clone --bare: Add ".git" suffix to the directory name to clone into
Jon Jensen (1):
Fix reference to Everyday Git, which is an HTML document and not a man
page.
Lee Marlow (11):
bash completion: remove unused function _git_diff_tree
bash completion: Add more long options for 'git log'
bash completion: Add completion for 'git grep'
bash completion: Add completion for 'git clone'
bash completion: Add completion for 'git clean'
bash completion: Add completion for 'git init'
bash completion: Add completion for 'git revert'
bash completion: More completions for 'git stash'
bash completion: Add completion for 'git archive'
bash completion: Add completion for 'git ls-files'
bash completion: Add completion for 'git mv'
Mike Ralphson (1):
Documentation: typos / spelling fixes
Steffen Prohaska (1):
Modify mingw_main() workaround to avoid link errors
Steven Grimm (1):
Optimize sha1_object_info for loose objects, not concurrent repacks
^ permalink raw reply
* What's in git.git (Aug 2008, #01; Tue, 05)
From: Junio C Hamano @ 2008-08-06 6:20 UTC (permalink / raw)
To: git; +Cc: Paul Mackerras, Shawn O. Pearce
Thanks to many people, we have accumulated quite a few fixes that are
appropriate for 1.6.0 stabilization effort but at the same time apply
equally well to 1.5.6 series. We might want to do 1.5.6.5 to flush them
while we are at it.
I am planning to tag 1.6.0-rc2 tomorrow evening. I noticed that both gitk
and git-gui have fixes and many updated translations that I intend to
pull before tagging -rc2.
* The 'maint' branch has these fixes since the last announcement.
Anders Melchiorsen (1):
Documentation: fix diff.external example
Brandon Casey (1):
t/t4202-log.sh: add newline at end of file
Ciaran McCreesh (1):
Make git-add -i accept ranges like 7-
Jeff King (1):
init: handle empty "template" parameter
Jim Meyering (1):
git-cvsimport.perl: Print "UNKNOWN LINE..." on stderr, not stdout.
Johannes Schindelin (1):
sort_in_topological_order(): avoid setting a commit flag
Jonathan Nieder (1):
git-diff(1): "--c" -> "--cc" typo fix
Junio C Hamano (6):
make sure parsed wildcard refspec ends with slash
Documentation: clarify diff --cc
Update my e-mail address
Start 1.5.6.5 RelNotes to describe accumulated fixes
builtin-name-rev.c: split deeply nested part from the main function
RelNotes 1.5.6.5 updates
Linus Torvalds (1):
diff.renamelimit is a basic diff configuration
Mike Ralphson (1):
Documentation: typos / spelling fixes in older RelNotes
Pierre Habouzit (1):
git-submodule: move ill placed shift.
Pieter de Bie (1):
git-name-rev: allow --name-only in combination with --stdin
René Scharfe (1):
git-name-rev: don't use printf without format
Stephan Beyer (1):
builtin-revert.c: typofix
Steve Haslam (1):
Propagate -u/--upload-pack option of "git clone" to transport.
* The 'master' branch has these since the last announcement
in addition to the above.
Abhijit Menon-Sen (4):
Git.pm: localise $? in command_close_bidi_pipe()
Fix hash slice syntax error
Fix typo in perl/Git.pm
Fix typos in INSTALL
Anders Melchiorsen (2):
Flush output in start_async
Add output flushing before fork()
Avery Pennarun (2):
Teach "git diff -p" Pascal/Delphi funcname pattern
git-svn: Abort with an error if 'fetch' parameter is invalid.
Brandon Casey (1):
Teach fsck and prune that tmp_obj_ file names may not be 14 bytes long
David D. Kilzer (1):
Fix race condition in t9119-git-svn-info.sh
Dmitry Potapov (1):
correct access right for git-svn-dcommit test
Eric Wong (2):
git-svn: properly set path for "info" command
t9119: conditionally re-enable test depending on svn(1) version
Giuseppe Bilotta (2):
diff: add ruby funcname pattern
diff: chapter and part in funcname for tex
Johannes Schindelin (2):
clone: Add an option to set up a mirror
clone --bare: Add ".git" suffix to the directory name to clone into
Jon Jensen (1):
Fix reference to Everyday Git, which is an HTML document and not a man
page.
Lee Marlow (11):
bash completion: remove unused function _git_diff_tree
bash completion: Add more long options for 'git log'
bash completion: Add completion for 'git grep'
bash completion: Add completion for 'git clone'
bash completion: Add completion for 'git clean'
bash completion: Add completion for 'git init'
bash completion: Add completion for 'git revert'
bash completion: More completions for 'git stash'
bash completion: Add completion for 'git archive'
bash completion: Add completion for 'git ls-files'
bash completion: Add completion for 'git mv'
Mike Ralphson (1):
Documentation: typos / spelling fixes
Steffen Prohaska (1):
Modify mingw_main() workaround to avoid link errors
Steven Grimm (1):
Optimize sha1_object_info for loose objects, not concurrent repacks
^ permalink raw reply
* What's cooking in git.git (Aug 2008, #01; Tue, 05)
From: Junio C Hamano @ 2008-08-06 6:20 UTC (permalink / raw)
To: git
Here are the topics that have been cooking. Commits prefixed
with '-' are only in 'pu' while commits prefixed with '+' are
in 'next'.
The topics list the commits in reverse chronological order. The topics
meant to be merged to the maintenance series have "maint-" in their names.
Due to increased activity level from people including GSoC students, I
expect 'next' to stay somewhat more active than previous rounds during the
1.6.0-rc cycle. The request for people who usually follow 'next' is the
same as usual, though. After -rc1 is tagged, please run 'master' for your
daily git use instead, in order to make sure 'master' does what it claims
to do without regression.
Tentative schedule, my wishful thinking:
- 1.6.0-rc2 (Aug 6)
- 1.6.0-rc3 (Aug 10)
----------------------------------------------------------------
[New Topics]
* jc/post-simplify (Sun Aug 3 17:47:16 2008 -0700) 3 commits
+ Topo-sort before --simplify-merges
+ revision traversal: show full history with merge simplification
+ revision.c: whitespace fix
"log --full-history" is with too much clutter, "log" itself is too cleverer
than some people, and here is the middle level of merge simplification.
* sp/smart-http (Sun Aug 3 00:25:17 2008 -0700) 2 commits
- [do not merge -- original version] Add Git-aware CGI for Git-aware
smart HTTP transport
- Add backdoor options to receive-pack for use in Git-aware CGI
The "magic" detection protocol was revised to use POST to info/refs; the
top one queued is from before that discussion.
* jc/add-stop-at-symlink (Mon Aug 4 00:52:37 2008 -0700) 2 commits
- add: refuse to add working tree items beyond symlinks
- update-index: refuse to add working tree items beyond symlinks
The performance impact of this needs to be discussed in a separate
thread.
* dp/hash-literally (Sun Aug 3 18:36:22 2008 +0400) 6 commits
+ add --no-filters option to git hash-object
+ add --path option to git hash-object
+ use parse_options() in git hash-object
+ correct usage help string for git-hash-object
+ correct argument checking test for git hash-object
+ teach index_fd to work with pipes
Gives a bit more flexibility to hash-objects by allowing us to lie about
the path the contents comes from.
* jn/svn-log (Sun Aug 3 14:07:21 2008 +0200) 1 commit
- git-svn: --clean-changelog=<style> to sanitize messages
Eric firmly rejected this one so I won't be merging this to 'next' but
this was an interesting firestarter for discussion nevertheless.
----------------------------------------------------------------
[On Hold and/or Cooking]
* rs/archive-parse-options (Fri Jul 25 12:41:26 2008 +0200) 1 commit
+ archive: allow --exec and --remote without equal sign
None of the following is for 1.6.0.
* mv/merge-custom (Sat Aug 2 10:08:38 2008 +0200) 6 commits
+ Builtin git-help.
+ builtin-help: always load_command_list() in cmd_help()
+ Add a second testcase for handling invalid strategies in git-merge
+ Add a new test for using a custom merge strategy
+ builtin-merge: allow using a custom strategy
+ builtin-help: make some internal functions available to other
builtins
* cc/merge-base-many (Sun Jul 27 13:47:22 2008 -0700) 4 commits
- git-merge-octopus: use (merge-base A (merge B C D E...)) for
stepwise merge
+ merge-base-many: add trivial tests based on the documentation
+ documentation: merge-base: explain "git merge-base" with more than
2 args
+ merge-base: teach "git merge-base" to drive underlying
merge_bases_many()
* rs/imap (Wed Jul 9 22:29:02 2008 +0100) 5 commits
+ Documentation: Improve documentation for git-imap-send(1)
+ imap-send.c: more style fixes
+ imap-send.c: style fixes
+ git-imap-send: Support SSL
+ git-imap-send: Allow the program to be run from subdirectories of
a git tree
Some people seem to prefer having this feature available also with gnutls.
Such an enhancement can be done in-tree on top of this series if they are
so inclined.
* cc/bisect (Fri Jul 25 05:36:37 2008 +0200) 2 commits
- bisect: only check merge bases when needed
- bisect: test merge base if good rev is not an ancestor of bad rev
The first one alone does not pass its self-test but combined together they
seem to. It does not build confidence as the latter one is supposed to be
an optimization only.
* jc/add-addremove (Tue Jul 22 22:30:40 2008 -0700) 2 commits
+ builtin-add.c: optimize -A option and "git add ."
+ builtin-add.c: restructure the code for maintainability
* jk/pager-swap (Tue Jul 22 03:14:12 2008 -0400) 2 commits
+ spawn pager via run_command interface
+ run-command: add pre-exec callback
This changes the parent-child relationship between the pager and the git
process. We used to make pager the parent which meant that the exit
status from git is lost from the caller.
* ph/enable-threaded (Mon Jul 21 11:23:43 2008 +0200) 1 commit
+ Enable threaded delta search on *BSD and Linux.
* sg/merge-options (Sun Apr 6 03:23:47 2008 +0200) 1 commit
+ merge: remove deprecated summary and diffstat options and config
variables
This was previously in "will be in master soon" category, but it turns out
that the synonyms to the ones this one deletes are fairly new invention
that happend in 1.5.6 timeframe, and we cannot do this just yet. Perhaps
in 1.7.0.
* jc/dashless (Thu Jun 26 16:43:34 2008 -0700) 2 commits
+ Revert "Make clients ask for "git program" over ssh and local
transport"
+ Make clients ask for "git program" over ssh and local transport
This is the "botched" one. Will be resurrected during 1.7.0 or 1.8.0
timeframe.
* jk/renamelimit (Sat May 3 13:58:42 2008 -0700) 1 commit
. diff: enable "too large a rename" warning when -M/-C is explicitly
asked for
This would be the right thing to do for command line use, but gitk will be
hit due to tcl/tk's limitation, so I am holding this back for now.
^ permalink raw reply
* [PATCH] fix diff-tree --stdin documentation
From: Junio C Hamano @ 2008-08-06 5:32 UTC (permalink / raw)
To: git; +Cc: Karl Hasselström
In-Reply-To: <7vwsivusy2.fsf@gitster.siamese.dyndns.org>
Long time ago, the feature of "diff-tree --stdin" to take a commit and its
parents on one line was broken, and did not support the common:
git rev-list --parents $commits... -- $paths... |
git diff-tree --stdin -v -p
usage pattern by Porcelains properly. For diff-tree to talk sensibly
about commits, it needs to see commits, not just trees; the code was fixed
to take list of commits on the standard input in 1.2.0.
However we left the documentation stale for a long time, until Karl
Hasselström finally noticed it very recently.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
diff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt
index 8c8f35b..1fdf20d 100644
--- a/Documentation/git-diff-tree.txt
+++ b/Documentation/git-diff-tree.txt
@@ -49,13 +49,13 @@ include::diff-options.txt[]
--stdin::
When '--stdin' is specified, the command does not take
<tree-ish> arguments from the command line. Instead, it
- reads either one <commit> or a pair of <tree-ish>
+ reads either one <commit> or a list of <commit>
separated with a single space from its standard input.
+
When a single commit is given on one line of such input, it compares
the commit with its parents. The following flags further affects its
-behavior. This does not apply to the case where two <tree-ish>
-separated with a single space are given.
+behavior. The remaining commits, when given, are used as if they are
+parents of the first commit.
-m::
By default, 'git-diff-tree --stdin' does not show
^ permalink raw reply related
* Re: [TopGit PATCH 1/2] Fix generated Subject: line in .topmsg
From: Bert Wesarg @ 2008-08-06 5:10 UTC (permalink / raw)
To: Petr Baudis; +Cc: Bert Wesarg, git
In-Reply-To: <1217963610-15195-1-git-send-email-bert.wesarg@googlemail.com>
Just a resend, because Petr didn't get this mail.
Bert
On Tue, Aug 5, 2008 at 21:13, Bert Wesarg <bert.wesarg@googlemail.com> wrote:
> $1 is unset after parsing all arguments, so use $name instead.
>
> Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
>
> ---
> tg-create.sh | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/tg-create.sh b/tg-create.sh
> index d196e4f..0bf329c 100644
> --- a/tg-create.sh
> +++ b/tg-create.sh
> @@ -107,7 +107,7 @@ author_addr="${author%> *}>"
> ! header="$(git config topgit.to)" || echo "To: $header"
> ! header="$(git config topgit.cc)" || echo "Cc: $header"
> ! header="$(git config topgit.bcc)" || echo "Bcc: $header"
> - echo "Subject: [PATCH] $1"
> + echo "Subject: [PATCH] $name"
> echo
> cat <<EOT
> <patch description>
> --
> tg: (24367cc..) t/fix-subject-line-in-.topmsg (depends on: master)
>
^ permalink raw reply
* Re: [TopGit PATCH 2/2] tg-create.sh: Introduce topgit.subjectprefix config option
From: Bert Wesarg @ 2008-08-06 5:08 UTC (permalink / raw)
To: Abhijit Menon-Sen, Git Mailing List
In-Reply-To: <20080805233930.GA1249@toroid.org>
On Wed, Aug 6, 2008 at 01:39, Abhijit Menon-Sen <ams@toroid.org> wrote:
> Hi Bert.
>
> I'm wondering how you managed to get two To: fields in your patch mail.
> Is it a git-send-email bug, or did you do something special?
Yeah, I noticed this too, I have a To: line in the mail file, formated
from tg patch, and than send it with git-send-mail with an --to
option. without this option git-send-mail has asked me for the
recipient.
Any help would be appreciate.
Thanks
Bert
>
> -- ams
>
^ permalink raw reply
* [EGIT PATCH 5/5] Correct getRepositoryMapping callers to use any IResource
From: Shawn O. Pearce @ 2008-08-06 3:09 UTC (permalink / raw)
To: Robin Rosenberg, Marek Zawirski; +Cc: git
In-Reply-To: <1217992180-5697-5-git-send-email-spearce@spearce.org>
We really need to use the exact resource we want a mapping for, even
if that is an IFile, because the file may be in a different repository
than the project it is contained in. This can happen due to linked
resources, or due to submodules. Either way the mapping cannot be
driven by the project.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
.../org/spearce/egit/core/op/UntrackOperation.java | 4 +---
.../egit/core/project/RepositoryMapping.java | 14 +++++++-------
.../egit/ui/internal/actions/CommitAction.java | 2 +-
3 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/op/UntrackOperation.java b/org.spearce.egit.core/src/org/spearce/egit/core/op/UntrackOperation.java
index 369ff38..b491e6d 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/op/UntrackOperation.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/op/UntrackOperation.java
@@ -15,7 +15,6 @@ import java.util.IdentityHashMap;
import java.util.Iterator;
import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.resources.IWorkspaceRunnable;
@@ -67,9 +66,8 @@ public class UntrackOperation implements IWorkspaceRunnable {
obj = ((IAdaptable)obj).getAdapter(IResource.class);
if (obj instanceof IResource) {
final IResource toRemove = (IResource)obj;
- final IProject p = toRemove.getProject();
final GitProjectData pd = GitProjectData.get(toRemove.getProject());
- final RepositoryMapping rm = pd.getRepositoryMapping(p);
+ final RepositoryMapping rm = pd.getRepositoryMapping(toRemove);
final GitIndex index = rm.getRepository().getIndex();
tomerge.put(rm, Boolean.TRUE);
if (toRemove instanceof IContainer) {
diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java b/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java
index 17e8142..961dbaf 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java
@@ -221,15 +221,15 @@ public class RepositoryMapping {
* @return the RepositoryMapping for this resource,
* or null for non GitProvider.
*/
- public static RepositoryMapping getMapping(IResource resource) {
- IProject project = resource.getProject();
+ public static RepositoryMapping getMapping(final IResource resource) {
+ final IProject project = resource.getProject();
if (project == null)
return null;
- RepositoryProvider provider = RepositoryProvider.getProvider(project);
- if (!(provider instanceof GitProvider))
+
+ final RepositoryProvider rp = RepositoryProvider.getProvider(project);
+ if (!(rp instanceof GitProvider))
return null;
- GitProvider gp = (GitProvider)provider;
- RepositoryMapping repositoryMapping = gp.getData().getRepositoryMapping(project);
- return repositoryMapping;
+
+ return ((GitProvider)rp).getData().getRepositoryMapping(resource);
}
}
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/CommitAction.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/CommitAction.java
index db38c10..4956be3 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/CommitAction.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/actions/CommitAction.java
@@ -363,7 +363,7 @@ public class CommitAction extends RepositoryAction {
try {
RepositoryMapping repositoryMapping = projectData
- .getRepositoryMapping(resource.getProject());
+ .getRepositoryMapping(resource);
if (isChanged(repositoryMapping, resource)) {
files.add(resource);
--
1.6.0.rc1.250.g9b5e2
^ permalink raw reply related
* [EGIT PATCH 4/5] Change GitProjectData.getRepositoryMapping to work on linked resources
From: Shawn O. Pearce @ 2008-08-06 3:09 UTC (permalink / raw)
To: Robin Rosenberg, Marek Zawirski; +Cc: git
In-Reply-To: <1217992180-5697-4-git-send-email-spearce@spearce.org>
When we are looking up the mapping for a file contained within a linked
directory the linked directory may be mapped to a Git repository that is
not the same as the project itself, or the project doesn't even have a
Git repository.
This may also be necessary for submodules. For example a single project
in Eclipse may actually contain several Git submodules below it and each
must have its own RepositoryMapping.
We now store the RepositoryMapping for a given IContainer directly on
that container using a session property. This way Eclipse manages the
hash lookups for us, and we can efficiently walk up the tree to locate
the nearest mapping for any resource.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
.../spearce/egit/core/project/GitProjectData.java | 47 +++++++++++++-------
1 files changed, 31 insertions(+), 16 deletions(-)
diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/project/GitProjectData.java b/org.spearce.egit.core/src/org/spearce/egit/core/project/GitProjectData.java
index 3d5424c..9998880 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/project/GitProjectData.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/project/GitProjectData.java
@@ -32,6 +32,7 @@ import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.RepositoryProvider;
import org.spearce.egit.core.Activator;
@@ -71,6 +72,9 @@ public class GitProjectData {
}
}
+ private static QualifiedName MAPPING_KEY = new QualifiedName(
+ GitProjectData.class.getName(), "RepositoryMapping");
+
/**
* Start listening for resource changes.
*
@@ -226,8 +230,6 @@ public class GitProjectData {
private final Collection mappings;
- private final Map c2mapping;
-
private final Set protectedResources;
/**
@@ -239,7 +241,6 @@ public class GitProjectData {
public GitProjectData(final IProject p) {
project = p;
mappings = new ArrayList();
- c2mapping = new HashMap();
protectedResources = new HashSet();
}
@@ -267,15 +268,16 @@ public class GitProjectData {
* @throws CoreException
*/
public void markTeamPrivateResources() throws CoreException {
- final Iterator i = c2mapping.entrySet().iterator();
- while (i.hasNext()) {
- final Map.Entry e = (Map.Entry) i.next();
- final IContainer c = (IContainer) e.getKey();
+ for (final Object rmObj : mappings) {
+ final RepositoryMapping rm = (RepositoryMapping)rmObj;
+ final IContainer c = rm.getContainer();
+ if (c == null)
+ continue; // Not fully mapped yet?
+
final IResource dotGit = c.findMember(".git");
if (dotGit != null) {
try {
- final Repository r = ((RepositoryMapping) e.getValue())
- .getRepository();
+ final Repository r = rm.getRepository();
final File dotGitDir = dotGit.getLocation().toFile()
.getCanonicalFile();
if (dotGitDir.equals(r.getDirectory())) {
@@ -298,14 +300,23 @@ public class GitProjectData {
}
/**
- * TODO: check usage, we should probably declare the parameter
- * as IProject.
- *
- * @param r Eclipse project
+ * @param r any workbench resource contained within this project.
* @return the mapping for the specified project
*/
- public RepositoryMapping getRepositoryMapping(final IResource r) {
- return (RepositoryMapping) c2mapping.get(r);
+ public RepositoryMapping getRepositoryMapping(IResource r) {
+ try {
+ while (r != null) {
+ final RepositoryMapping m;
+
+ m = (RepositoryMapping) r.getSessionProperty(MAPPING_KEY);
+ if (m != null)
+ return m;
+ r = r.getParent();
+ }
+ } catch (CoreException err) {
+ Activator.logError("Falied finding RepositoryMapping", err);
+ }
+ return null;
}
private void delete() {
@@ -445,7 +456,11 @@ public class GitProjectData {
m.fireRepositoryChanged();
trace("map " + c + " -> " + m.getRepository());
- c2mapping.put(c, m);
+ try {
+ c.setSessionProperty(MAPPING_KEY, m);
+ } catch (CoreException err) {
+ Activator.logError("Failed to cache RepositoryMapping", err);
+ }
dotGit = c.findMember(".git");
if (dotGit != null && dotGit.getLocation().toFile().equals(git)) {
--
1.6.0.rc1.250.g9b5e2
^ permalink raw reply related
* [EGIT PATCH 3/5] Fix RepositoryMapping.getRepoRelativePath to honor linked resources
From: Shawn O. Pearce @ 2008-08-06 3:09 UTC (permalink / raw)
To: Robin Rosenberg, Marek Zawirski; +Cc: git
In-Reply-To: <1217992180-5697-3-git-send-email-spearce@spearce.org>
If a project resource is linked to a repository working directory we
should be locating the path of the resource within the repository by
the path it appears in the filesystem, not the path it appears at in
the Eclipse project structure. By using the filesystem location we
can ensure the paths match what C Git would see when accessing the
same resource.
By making this change we can now safely remove the subset concept
from RepositoryMapping as it was a crude form of trying to come up
with the same result when projects appeared within a repository.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
.../egit/core/op/ConnectProviderOperation.java | 14 +----
.../egit/core/project/RepositoryFinder.java | 11 +--
.../egit/core/project/RepositoryMapping.java | 65 ++++++++-----------
3 files changed, 32 insertions(+), 58 deletions(-)
diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/op/ConnectProviderOperation.java b/org.spearce.egit.core/src/org/spearce/egit/core/op/ConnectProviderOperation.java
index 3ed3569..bf814f4 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/op/ConnectProviderOperation.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/op/ConnectProviderOperation.java
@@ -15,10 +15,8 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.team.core.RepositoryProvider;
import org.spearce.egit.core.Activator;
@@ -70,17 +68,7 @@ public class ConnectProviderOperation implements IWorkspaceRunnable {
db = new Repository(newGitDir);
db.create();
- IPath gitDirParent = Path.fromOSString(
- db.getDirectory().getAbsolutePath())
- .removeLastSegments(1);
- IPath cPath = project.getLocation();
- String subset = null;
- if (gitDirParent.isPrefixOf(cPath)) {
- int n = cPath.matchingFirstSegments(gitDirParent);
- subset = cPath.removeFirstSegments(n).toPortableString();
- }
- repos.add(new RepositoryMapping(project, db.getDirectory(),
- subset));
+ repos.add(new RepositoryMapping(project, db.getDirectory()));
db.close();
// If we don't refresh the project directory right
diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryFinder.java b/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryFinder.java
index 68cf79c..116a7bf 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryFinder.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryFinder.java
@@ -92,17 +92,15 @@ public class RepositoryFinder {
final IResource[] children;
if (ownCfg.isFile()) {
- register(c, ownCfg.getParentFile(), null);
+ register(c, ownCfg.getParentFile());
} else if (c.isLinked() || c instanceof IProject) {
- String s = fsLoc.getName();
File p = fsLoc.getParentFile();
while (p != null) {
final File pCfg = configFor(p);
if (pCfg.isFile()) {
- register(c, pCfg.getParentFile(), s);
+ register(c, pCfg.getParentFile());
break;
}
- s = p.getName() + "/" + s;
p = p.getParentFile();
}
}
@@ -132,14 +130,13 @@ public class RepositoryFinder {
return new File(new File(fsLoc, ".git"), "config");
}
- private void register(final IContainer c, final File gitdir,
- final String subset) {
+ private void register(final IContainer c, final File gitdir) {
File f;
try {
f = gitdir.getCanonicalFile();
} catch (IOException ioe) {
f = gitdir.getAbsoluteFile();
}
- results.add(new RepositoryMapping(c, f, subset));
+ results.add(new RepositoryMapping(c, f));
}
}
diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java b/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java
index 6a0b56f..17e8142 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/project/RepositoryMapping.java
@@ -41,10 +41,10 @@ public class RepositoryMapping {
private final String gitdirPath;
- private final String subset;
-
private Repository db;
+ private String workdirPrefix;
+
private IContainer container;
/**
@@ -55,12 +55,9 @@ public class RepositoryMapping {
*/
public RepositoryMapping(final Properties p, final String initialKey) {
final int dot = initialKey.lastIndexOf('.');
- String s;
containerPath = initialKey.substring(0, dot);
gitdirPath = p.getProperty(initialKey);
- s = p.getProperty(containerPath + ".subset");
- subset = "".equals(s) ? null : s;
}
/**
@@ -69,10 +66,8 @@ public class RepositoryMapping {
*
* @param mappedContainer
* @param gitDir
- * @param subsetRoot
*/
- public RepositoryMapping(final IContainer mappedContainer,
- final File gitDir, final String subsetRoot) {
+ public RepositoryMapping(final IContainer mappedContainer, final File gitDir) {
final IPath cLoc = mappedContainer.getLocation()
.removeTrailingSeparator();
final IPath gLoc = Path.fromOSString(gitDir.getAbsolutePath())
@@ -98,8 +93,6 @@ public class RepositoryMapping {
} else {
gitdirPath = gLoc.toPortableString();
}
-
- subset = "".equals(subsetRoot) ? null : subsetRoot;
}
IPath getContainerPath() {
@@ -111,17 +104,6 @@ public class RepositoryMapping {
}
/**
- * Eclipse projects typically reside one or more levels
- * below the repository. This method return the relative
- * path to the project. Null is returned instead of "".
- *
- * @return relative path from repository to project, or null
- */
- public String getSubset() {
- return subset;
- }
-
- /**
* @return the workdir file, i.e. where the files are checked out
*/
public File getWorkDir() {
@@ -130,6 +112,7 @@ public class RepositoryMapping {
synchronized void clear() {
db = null;
+ workdirPrefix = null;
container = null;
}
@@ -142,6 +125,15 @@ public class RepositoryMapping {
synchronized void setRepository(final Repository r) {
db = r;
+
+ try {
+ workdirPrefix = getWorkDir().getCanonicalPath();
+ } catch (IOException err) {
+ workdirPrefix = getWorkDir().getAbsolutePath();
+ }
+ workdirPrefix = workdirPrefix.replace('\\', '/');
+ if (!workdirPrefix.endsWith("/"))
+ workdirPrefix += "/";
}
/**
@@ -166,9 +158,6 @@ public class RepositoryMapping {
synchronized void store(final Properties p) {
p.setProperty(containerPath + ".gitdir", gitdirPath);
- if (subset != null && !"".equals(subset)) {
- p.setProperty(containerPath + ".subset", subset);
- }
}
public String toString() {
@@ -209,20 +198,20 @@ public class RepositoryMapping {
* @param rsrc
* @return the path relative to the Git repository, including base name.
*/
- public String getRepoRelativePath(IResource rsrc) {
- String prefix = getSubset();
- String projectRelativePath = rsrc.getProjectRelativePath().toString();
- String repoRelativePath;
- if (prefix != null) {
- if (projectRelativePath.length() == 0)
- repoRelativePath = prefix;
- else
- repoRelativePath = prefix + "/" + projectRelativePath;
- } else
- repoRelativePath = projectRelativePath;
-
- assert repoRelativePath != null;
- return repoRelativePath;
+ public String getRepoRelativePath(final IResource rsrc) {
+ // We should only be called for resources that are actually
+ // in this repository, so we can safely assume that their
+ // path prefix matches workdirPrefix. Testing that here is
+ // rather expensive so we don't bother.
+ //
+ final int pfxLen = workdirPrefix.length();
+ final String p = rsrc.getLocation().toString();
+ final int pLen = p.length();
+ if (pLen > pfxLen)
+ return p.substring(pfxLen);
+ else if (p.length() == pfxLen - 1)
+ return "";
+ return null;
}
/**
--
1.6.0.rc1.250.g9b5e2
^ permalink raw reply related
* [EGIT PATCH 2/5] Don't crash the decorator update loop when resources are deleted
From: Shawn O. Pearce @ 2008-08-06 3:09 UTC (permalink / raw)
To: Robin Rosenberg, Marek Zawirski; +Cc: git
In-Reply-To: <1217992180-5697-2-git-send-email-spearce@spearce.org>
If a resource is deleted from the workspace we don't need to clear
its GITFOLDERDIRTYSTATEPROPERTY from the item because it is gone.
There won't be anyone else to query for that flag, so the flag is
not relevant anymore. Further trying to call accept() on those
resources throws an exception because Eclipse won't let you touch
a deleted resource.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
.../internal/decorators/GitResourceDecorator.java | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java
index 6d2f88e..84ad949 100644
--- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java
+++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/GitResourceDecorator.java
@@ -126,6 +126,14 @@ public class GitResourceDecorator extends LabelProvider implements
Iterator<IResource> i = resources.iterator();
m = i.next();
i.remove();
+
+ while (!m.isAccessible()) {
+ if (!i.hasNext())
+ return Status.OK_STATUS;
+ m = i.next();
+ i.remove();
+ }
+
if (resources.size() > 0)
schedule();
}
@@ -188,8 +196,7 @@ public class GitResourceDecorator extends LabelProvider implements
} // End ResCL
void clearDecorationState(IResource r) throws CoreException {
- if (r.isAccessible())
- r.setSessionProperty(GITFOLDERDIRTYSTATEPROPERTY, null);
+ r.setSessionProperty(GITFOLDERDIRTYSTATEPROPERTY, null);
fireLabelProviderChanged(new LabelProviderChangedEvent(this, r));
}
--
1.6.0.rc1.250.g9b5e2
^ permalink raw reply related
* [EGIT PATCH 1/5] Remove the pointless GitProjectData resource change listener
From: Shawn O. Pearce @ 2008-08-06 3:09 UTC (permalink / raw)
To: Robin Rosenberg, Marek Zawirski; +Cc: git
In-Reply-To: <1217992180-5697-1-git-send-email-spearce@spearce.org>
Apparently on any IResourceChangeEvent.POST_CHANGE we just burn some
CPU time and generate some garbage for the GC to clean out later. I
cannot see a reason why this code is still here. My memory says we
did this in the past to notify the resource decorator that it needs
to update, or we used it for our cache tree invalidation.
Since this code has no side effect other than to waste time we can
safely remove it, and cut our project down a little bit.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
.../spearce/egit/core/project/GitProjectData.java | 64 --------------------
1 files changed, 0 insertions(+), 64 deletions(-)
diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/project/GitProjectData.java b/org.spearce.egit.core/src/org/spearce/egit/core/project/GitProjectData.java
index 8754bd1..3d5424c 100644
--- a/org.spearce.egit.core/src/org/spearce/egit/core/project/GitProjectData.java
+++ b/org.spearce.egit.core/src/org/spearce/egit/core/project/GitProjectData.java
@@ -29,8 +29,6 @@ import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Preferences;
@@ -61,10 +59,6 @@ public class GitProjectData {
@SuppressWarnings("synthetic-access")
public void resourceChanged(final IResourceChangeEvent event) {
switch (event.getType()) {
- case IResourceChangeEvent.POST_CHANGE:
- projectsChanged(event.getDelta().getAffectedChildren(
- IResourceDelta.CHANGED));
- break;
case IResourceChangeEvent.PRE_CLOSE:
uncache((IProject) event.getResource());
break;
@@ -182,16 +176,6 @@ public class GitProjectData {
Activator.trace("(GitProjectData) " + m);
}
- private static void projectsChanged(final IResourceDelta[] projDeltas) {
- for (int k = 0; k < projDeltas.length; k++) {
- final IResource r = projDeltas[k].getResource();
- final GitProjectData d = get((IProject) r);
- if (d != null) {
- d.notifyChanged(projDeltas[k]);
- }
- }
- }
-
private synchronized static void cache(final IProject p,
final GitProjectData d) {
projectDataCache.put(p, d);
@@ -380,54 +364,6 @@ public class GitProjectData {
}
}
- private void notifyChanged(final IResourceDelta projDelta) {
-// final Set affectedMappings = new HashSet();
- try {
- projDelta.accept(new IResourceDeltaVisitor() {
- public boolean visit(final IResourceDelta d)
- throws CoreException {
- final int f = d.getFlags();
- IResource res = d.getResource();
- IResource r = res;
- if ((f & IResourceDelta.CONTENT) != 0
- || (f & IResourceDelta.ENCODING) != 0
- || r instanceof IContainer) {
- String s = null;
- RepositoryMapping m = null;
-
- while (r != null) {
- m = getRepositoryMapping(r);
- if (m != null) {
- break;
- }
-
- if (s != null) {
- s = r.getName() + "/" + s;
- } else {
- s = r.getName();
- }
-
- r = r.getParent();
- }
-
- if (m == null) {
- return false;
- } else if (s == null) {
- return true;
- }
- }
- return false;
- }
- });
- } catch (CoreException ce) {
- // We are in deep trouble. This should NOT have happend. Detach
- // our listeners and forget it ever did.
- //
- detachFromWorkspace();
- Activator.logError(CoreText.GitProjectData_notifyChangedFailed, ce);
- }
- }
-
private File propertyFile() {
return new File(getProject()
.getWorkingLocation(Activator.getPluginId()).toFile(),
--
1.6.0.rc1.250.g9b5e2
^ permalink raw reply related
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