Git development
 help / color / mirror / Atom feed
* Re: [PATCH] tagger id
From: Eric W. Biederman @ 2005-07-12 22:15 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Git Mailing List
In-Reply-To: <Pine.LNX.4.58.0507121152260.17536@g5.osdl.org>

Linus Torvalds <torvalds@osdl.org> writes:

> Eric,
>  I ended up coding the ident stuff a bit differently, and I didn't do done
> the tag/git-id part yet. Can you check out my latest commit (pushed out, 
> but it will probably take a few minutes to mirror out), and do the final 
> tag stuff based on that? 

For the most part it looks sane.   I'm not really thrilled that
setup_ident() calls die, and when complaining about the user
name we should probably complain that their sysadmin hated
then if it is over a 1000 characters not their parents :)

I'm also not at all thrilled with global variables.  Globals aren't
the source of all evil but they have a lot better claim than goto.
At least real_email and friends are file local.  If you like
it and the code works git is you project and I won't complain again.

Since we are still looking at this there is one change in the user
interface I would like to make to simplify things for the end user.
The only time when GIT_COMMITTER != GIT_AUTHOR is in git_commit_script
when we you are making a new commit based on an old commit. Can
we add a command line option to git-commit-write, --author
that will allow the author field to be overridden.  Allowing us
to get down to a single set of GIT variables for specifying who
the user is?

That also simplifies the tagging case and answers the question 
which environment variables tags should look at, to see who the
user is. 

Eric

^ permalink raw reply

* Re: [PATCH] tagger id
From: Junio C Hamano @ 2005-07-12 23:42 UTC (permalink / raw)
  To: git
In-Reply-To: <m1pstnzn5j.fsf@ebiederm.dsl.xmission.com>

Eric W. Biederman <ebiederm <at> xmission.com> writes:

> Since we are still looking at this there is one change in the user
> interface I would like to make to simplify things for the end user.
> The only time when GIT_COMMITTER != GIT_AUTHOR is in git_commit_script
> when we you are making a new commit based on an old commit...

I am afraid I do not follow you.  For a "project lead" person like Linus, who
takes an e-mail submission of patches, GIT_AUTHOR is almost always different
from the committer, and typically set up by the program that reads the e-mail
to snarf the From: and Date: lines via environment variables, when the incoming
patches are being processed.  He is saying "I am the COMMITTER, and this commit
I am making is written by this AUTHOR".

AUTHOR can be set to somebody other than yourself and that is a typical mode
of operation for a "project lead" person.

On the other hand, we made COMMITTER overridable only because (1) the
computed value from the system are often not quite right on many systems
with weird GECOS field or domain/e-mail setup, and (2) when converting from
a foreign SCM, we wanted to keep the committer information (and dates), if
available.  Only in (2), which is quite a special case, COMMITTER names
somebody different from yourself.

What this means is that if you are asking the question "who the user is",
the answer _should_ always come from COMMITTER.  

> That also simplifies the tagging case and answers the question 
> which environment variables tags should look at, to see who the
> user is. 

The intent of "tags" (especially the signed kind) is to express "trust":
"This commit is called v2.6.12 and *I* vouch for it."

COMMITTER is the only sensible thing to use there, because (as you said)
what you care is "who I am", not "for whom I am doing this".  

^ permalink raw reply

* Re: [PATCH] git-cvsimport-script: parse multidigit revisions
From: Matthias Urlichs @ 2005-07-13  1:18 UTC (permalink / raw)
  To: Sven Verdoolaege; +Cc: Linus Torvalds, Git Mailing List
In-Reply-To: <20050712213531.GA10936@pc117b.liacs.nl>

[-- Attachment #1: Type: text/plain, Size: 422 bytes --]

Hi,

Sven Verdoolaege:
> Previously, git-cvsimport-script would fail
> on revisions with more than one digit.
> 
Ouch. Thanks.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
When a guy says...
Good idea.
	He really means....
It'll never work.  And I'll spend the rest of the day gloating.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* [PATCH] Support more http features: https no cert, .netrc -> auth
From: Darrin Thompson @ 2005-07-13  2:12 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

Cause setting environment variable GIT_SSL_NO_VERIFY to turn off
curl's ssl peer verification.

Only use curl for http transfers, instead of curl and wget.

Make curl check ~/.netrc for credentials.

---
commit 229718f5723f81304c7c038c18d1e1bd630026ae
tree 501594e7b424855f08d7bef6bd4f9721d40d4a3c
parent e30e814dbfef7a6e89418863e5d7291a2d53b18f
author Darrin Thompson <darrint@progeny.com> Tue, 12 Jul 2005 16:27:05 -0500

 git-fetch-script |    7 +++++--
 http-pull.c      |    6 ++++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/git-fetch-script b/git-fetch-script
--- a/git-fetch-script
+++ b/git-fetch-script
@@ -14,8 +14,11 @@ fi
 TMP_HEAD="$GIT_DIR/TMP_HEAD"
 
 case "$merge_repo" in
-http://*)
-	head=$(wget -q -O - "$merge_repo/$merge_name") || exit 1
+http://*|https://*)
+        if [ -n "$GIT_SSL_NO_VERIFY" ]; then
+            curl_extra_args="-k"
+        fi
+	head=$(curl -ns $curl_extra_args "$merge_repo/$merge_name") || exit 1
 	echo Fetching $head using http
 	git-http-pull -v -a "$head" "$merge_repo/"
 	;;
diff --git a/http-pull.c b/http-pull.c
--- a/http-pull.c
+++ b/http-pull.c
@@ -16,6 +16,8 @@ static z_stream stream;
 static int local;
 static int zret;
 
+static int curl_ssl_verify;
+
 struct buffer
 {
         size_t posn;
@@ -173,6 +175,10 @@ int main(int argc, char **argv)
 
 	curl = curl_easy_init();
 
+	curl_ssl_verify = gitenv("GIT_SSL_NO_VERIFY") ? 0 : 1;
+	curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, curl_ssl_verify);
+	curl_easy_setopt(curl, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
+
 	base = url;
 
 	if (pull(commit_id))

^ permalink raw reply

* Re: How to get a directory filled with v2.6.11?
From: Linus Torvalds @ 2005-07-13  4:37 UTC (permalink / raw)
  To: Marc Singer; +Cc: Git Mailing List
In-Reply-To: <20050712050347.GA10751@buici.com>



On Mon, 11 Jul 2005, Marc Singer wrote:
>
> I switched to using the git version in source control.
> Checkout/branching works great.  :-)
> 
> But, this version of git doesn't let me do
> 
>   # git checkout -f v2.6.11
>   error: Object 5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c is a tree, not a commit
>   Needed a single revision
> 
> which I suspect is protection added to prevent my special sort of
> shenanigans.  If I cannot perform the checkout anymore, is there
> another way to fill a directory with the contents of that particular
> tree?

Yes. Multiple ways. 

You can

 - just force that tree to be checked out:

	git-read-tree -m v2.6.11
	git-checkout-cache -f -u -a

   this basically gets you the state at the time of v2.6.11, but you still 
   don't have a _commit_ yet, so you'd have nothing to start actual 
   development from. BE CAREFUL! Your "HEAD" is now pointing to something 
   else than what you have checked out, so the next thing you want to do 
   is fix that up.

 - now, you can commit that as a _parentless_ commit (ie an "Initial
   commit") on a new branch, with something like this:

	echo "Linux 2.6.11" | git-commit-tree $(git-write-tree) > .git/refs/heads/my-branch
	ln -sf .git/HEAD refs/heads/my-branch

   and off you go. The above just creates a commit of the tree (which is 
   the v2.6.11 tree, since you did a "git-read-tree" on it), and uses the
   commit message "Linux 2.6.11"). It gives it no parents, and writes the
   result to the "my-branch" thing. It then makes HEAD point to that 
   branch, which completes the thing, and now your tree is in a consistent 
   state (ie HEAD matches what you have checked out, which matches 
   v2.6.11)

That's one way.

You can do it sneakier too, if you want to, and create the branch first. 
In particular, you can do

	git-cat-file tag v2.6.11

which will print out that tag, which starts with:

	object c39ae07f393806ccf406ef966e9a15afc43cc36a
	type tree
	tag v2.6.11-tree
	...

and now you can just do use that tree directly, without even reading it 
in:

	head=$(echo "Linux 2.6.11" | git-commit-tree c39ae07f393806ccf406ef966e9a15afc43cc36a)
	echo $head > .git/refs/heads/my-branch

which will give you the new branch.

Now you can just do

	git checkout my-branch

and you'll be there.

That said, whatever you do you will eventually end up with a series of
commits that are not related to the "normal" commits in the 2.6.12-rc2+
chain, and since they don't have a common point, git won't be able to
merge them for you. Git will be able to _track_ them for you, but at some
point you'll want to probably try to move them forward to the "rest" of
the git history.

And I'll warn you that that is not going to be entirely trivial, although
Junio's "cherrypick" scripts should be useful as a way to automate it at
least to some degree. This is why it would be so much easier if you could 
have started with a 2.6.12-rc2 or other "real" commit ;)

			Linus

^ permalink raw reply

* cg-init find error message on empty project directory
From: Jerry Seutter @ 2005-07-13  4:47 UTC (permalink / raw)
  To: Git Mailing List

When I run cg-init on an empty directory, it displays the following output:

$ cg-init
defaulting to local storage area
find: *: No such file or directory
Committing initial tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
Committed as d25f00309e336884854de8cab8ab9e819294bb83.

Is the find error message supposed to be displayed?

Jerry

^ permalink raw reply

* Re: [RFC PATCH] cogito --- don't overwrite metadata files in place (breaks CoW use)
From: Chris Wedgwood @ 2005-07-13  4:53 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git
In-Reply-To: <loom.20050712T233332-364@post.gmane.org>

On Tue, Jul 12, 2005 at 09:37:00PM +0000, Junio C Hamano wrote:

> >  if [ "$newhead" ]; then
> >  	echo "Committed as $newhead."
> > -	echo $newhead >$_git/HEAD
> > +	echo_to_file $newhead $_git/HEAD
> >  	[ "$merging" ] && rm $_git/merging $_git/merging-sym $_git/merge-base
>
> Good intentions, but wouldn't the above clobber symlinked HEAD?

Yeah, but I would argue that is the right thing to do.

Symlink'd trees don't really make sense to me (they seem fragile and
somewhat pointless) but perhaps I'm missing something?

> Not a fundamental flaw, though.  You need to see if it is a symlink,
> readlink it (repeatedly until you get a regular file or dangling
> symlink target that does not exist --- immediately after git-init-db
> has such a HEAD) and run your echo_to_file on the link target.

I don't see how that's helpful.  The idea of echo_to_file is to make
the metadata self-contained to the subtree --- so we don't want to
have external links (possibly) pointing outside of it.

^ permalink raw reply

* Re: Compilation troubles
From: Matthias Urlichs @ 2005-07-13  6:56 UTC (permalink / raw)
  To: git
In-Reply-To: <B1091462CF5479489B1D8FE818330D2C01371D9F@exchange2003.ad.skymv.com>

Hi, Dan Kohn wrote:

> UBUNTU 5.04

You want zlib1g-dev, libssl-dev, asciidoc, xmlto, libcurl3-dev.

I'll prepare a patch to do a simple set of Debian packages (so that "make
debian" works) for git(k)/cogito. I already use them locally, but that
branch is too unclean. :-/

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
The City of Palo Alto, in its official description of parking lot standards,
specifies the grade of wheelchair access ramps in terms of centimeters of
rise per foot of run.  A compromise, I imagine...

^ permalink raw reply

* Re: [RFC PATCH] cogito --- don't overwrite metadata files in place (breaks CoW use)
From: Matthias Urlichs @ 2005-07-13  7:03 UTC (permalink / raw)
  To: git
In-Reply-To: <20050713045338.GA19819@taniwha.stupidest.org>

Hi, Chris Wedgwood wrote:

> Symlink'd trees don't really make sense to me (they seem fragile and
> somewhat pointless) but perhaps I'm missing something?

You are ;-)  the tree itsels is no symlinked, but HEAD points to
refs/heads/<branch> by default.

Don't clobber that, please.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Though many hands make light work, too many cooks spoil the broth.

^ permalink raw reply

* Re: [ANNOUNCE] Cogito 0.12.1
From: Russell King @ 2005-07-13  7:12 UTC (permalink / raw)
  To: Petr Baudis, Linus Torvalds; +Cc: git
In-Reply-To: <20050712010058.GE5981@pasky.ji.cz>

Grumble.

I won't bother trying to explain, I'll just paste the errors.  We've been
here before in a previous cogito revision.

rmk@dyn-67:[linux-2.6-rmk]:<1038> cg-branch-ls
origin  ../linux-2.6
smp     ../linux-2.6-smp
rmk@dyn-67:[linux-2.6-rmk]:<1039> cg-pull origin
...
cp: cannot create link `.git/objects/f5/77ffd75c02b6087d5bf5ca89f806b10f2a0246': File exists
cp: cannot create link `.git/objects/f5/e02df58c1f92cdec1cc18cd3b7eeb48fb6d0e3': File exists
cp: cannot create link `.git/objects/f6/7ca01b4982f9e01e590468bae49bf0801bc756': File exists
cp: cannot create link `.git/objects/f7/4e32e0ff3d556da1992c4e0418a89aa1ed2e64': File exists
cp: cannot create link `.git/objects/fe/72a5b08ac185c230e0af6929c25061b7459b32': File exists
cp: cannot create link `.git/objects/ff/37bc27e6034281e7686007210554c54377d420': File exists
progress: 4707 objects, 13903516 bytes, 100% done
`../linux-2.6/.git/objects/pack' -> `.git/objects/pack'
`../linux-2.6/.git/objects/pack/pack-e3117bbaf6a59cb53c3f6f0d9b17b9433f0e4135.idx' -> `.git/objects/pack/pack-e3117bbaf6a59cb53c3f6f0d9b17b9433f0e4135.idx'
`../linux-2.6/.git/objects/pack/pack-e3117bbaf6a59cb53c3f6f0d9b17b9433f0e4135.pack' -> `.git/objects/pack/pack-e3117bbaf6a59cb53c3f6f0d9b17b9433f0e4135.pack'
cg-pull: objects pull failed

-- 
Russell King

^ permalink raw reply

* [PATCH] stgit: new --message does not work
From: Bryan Larsen @ 2005-07-13  8:38 UTC (permalink / raw)
  To: bryan.larsen; +Cc: Bryan Larsen, git, catalin.marinas
In-Reply-To: <20050713083805.18461.87079.sendpatchset@bryan-larsens-ibook-g4.local>

Stacked GIT: Using the --message option with the new command fails.  Fix it.

Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
---

 stgit/stack.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/stgit/stack.py b/stgit/stack.py
--- a/stgit/stack.py
+++ b/stgit/stack.py
@@ -384,6 +384,8 @@ class Series:
             descr = edit_file(None, \
                               'Please enter the description for patch "%s" ' \
                               'above.' % name)
+	else:
+	    descr = message
 
         head = git.get_head()
 

^ permalink raw reply

* [PATCH] stgit: allow spaces in filenames
From: Bryan Larsen @ 2005-07-13  8:38 UTC (permalink / raw)
  To: bryan.larsen; +Cc: Bryan Larsen, git, catalin.marinas

The current version of stgit does not allow whitespace in filenames.  This patch fixes that.  It also speeds up operations on large filesets considerably.

Signed-off-by: Bryan Larsen <bryan.larsen@gmail.com>
---

 stgit/git.py  |  158 +++++++++++++++++++++++++++++++--------------------------
 stgit/main.py |    8 +--
 2 files changed, 90 insertions(+), 76 deletions(-)

diff --git a/stgit/git.py b/stgit/git.py
--- a/stgit/git.py
+++ b/stgit/git.py
@@ -101,6 +101,24 @@ def __output(cmd):
         raise GitException, '%s failed' % cmd
     return string
 
+# __run: runs cmd using spawnvp.
+#
+#  The shell is avoided so it won't mess up our arguments.
+# If args is very large, the command is run multiple times;
+# args is split xargs style:  cmd is passed on each invocation.
+# Unlike xargs, returns immediately if any non-zero return code 
+# is received.
+#
+def __run(cmd, args=None):
+    args_l=cmd.split()
+    if args is None:
+	args = []
+    for i in range(0, len(args)+1, 1000):
+	r=os.spawnvp(os.P_WAIT, args_l[0], args_l + args[i:min(i+1000, len(args))])
+	if r:
+	    return r
+    return 0
+
 def __check_base_dir():
     return os.path.isdir(base_dir)
 
@@ -114,14 +132,16 @@ def __tree_status(files = [], tree_id = 
     # unknown files
     if unknown:
         exclude_file = os.path.join(base_dir, 'exclude')
-        extra_exclude = ''
+        extra_exclude = []
         if os.path.exists(exclude_file):
-            extra_exclude += ' --exclude-from=%s' % exclude_file
-        fout = os.popen('git-ls-files --others'
-                        ' --exclude="*.[ao]" --exclude=".*"'
-                        ' --exclude=TAGS --exclude=tags --exclude="*~"'
-                        ' --exclude="#*"' + extra_exclude, 'r')
+            extra_exclude.append('--exclude-from=%s' % exclude_file)
+        fin, fout = os.popen2(['git-ls-files', '--others',
+                        '--exclude=*.[ao]', '--exclude=.*'
+                        '--exclude=TAGS', '--exclude=tags', '--exclude=*~',
+                        '--exclude=#*'] + extra_exclude)
         cache_files += [('?', line.strip()) for line in fout]
+	fin.close()
+	fout.close()
 
     # conflicted files
     conflicts = get_conflicts()
@@ -130,13 +150,12 @@ def __tree_status(files = [], tree_id = 
     cache_files += [('C', filename) for filename in conflicts]
 
     # the rest
-    files_str = reduce(lambda x, y: x + ' ' + y, files, '')
-    fout = os.popen('git-diff-cache -r %s %s' % (tree_id, files_str), 'r')
+    fin, fout = os.popen2(['git-diff-cache', '-r', tree_id] + files)
     for line in fout:
-        fs = tuple(line.split()[4:])
+        fs = tuple(line.rstrip().split(' ',4)[-1].split('\t',1))
         if fs[1] not in conflicts:
             cache_files.append(fs)
-    if fout.close():
+    if fout.close() or fin.close():
         raise GitException, 'git-diff-cache failed'
 
     return cache_files
@@ -185,10 +204,9 @@ def add(names):
         else:
             raise GitException, '%s is not a file or directory' % i
 
-    for f in files:
-        print 'Adding file %s' % f
-        if os.system('git-update-cache --add -- %s' % f) != 0:
-            raise GitException, 'Unable to add %s' % f
+    if files:
+	if __run('git-update-cache --add --', files):
+            raise GitException, 'Unable to add file'
 
 def rm(files, force = False):
     """Remove a file from the repository
@@ -198,26 +216,32 @@ def rm(files, force = False):
     else:
         git_opt = '--remove'
 
-    for f in files:
-        if force:
-            print 'Removing file %s' % f
-            if os.system('git-update-cache --force-remove -- %s' % f) != 0:
-                raise GitException, 'Unable to remove %s' % f
-        elif os.path.exists(f):
-            raise GitException, '%s exists. Remove it first' %f
-        else:
-            print 'Removing file %s' % f
-            if os.system('git-update-cache --remove -- %s' % f) != 0:
-                raise GitException, 'Unable to remove %s' % f
+    if not force:
+	for f in files:
+	    if os.path.exists(f):
+		raise GitException, '%s exists. Remove it first' %f
+	if files:
+	    __run('git-update-cache --remove --', files)
+    else:
+	if files:
+	    __run('git-update-cache --force-remove --', files)
 
 def update_cache(files):
     """Update the cache information for the given files
     """
+    files_here = []
+    files_gone = []
+
     for f in files:
         if os.path.exists(f):
-            os.system('git-update-cache -- %s' % f)
+	    files_here.append(f)
         else:
-            os.system('git-update-cache --remove -- %s' % f)
+	    files_gone.append(f)
+
+    if files_here:
+	__run('git-update-cache --', files_here)
+    if files_gone:
+	__run('git-update-cache --remove --', files_gone)
 
 def commit(message, files = [], parents = [], allowempty = False,
            author_name = None, author_email = None, author_date = None,
@@ -248,16 +272,26 @@ def commit(message, files = [], parents 
 
     # update the cache
     if not first:
+	add_files=[]
+	rm_files=[]
+	m_files=[]
         for f in cache_files:
             if f[0] == 'N':
-                git_flag = '--add'
+		add_files.append(f[1])
             elif f[0] == 'D':
-                git_flag = '--force-remove'
+		rm_files.append(f[1])
             else:
-                git_flag = '--'
+                m_files.append(f[1])
 
-            if os.system('git-update-cache %s %s' % (git_flag, f[1])) != 0:
-                raise GitException, 'Failed git-update-cache -- %s' % f[1]
+	if add_files:
+	    if __run('git-update-cache --add --', add_files):
+		raise GitException, 'Failed git-update-cache --add'
+	if rm_files:
+	    if __run('git-update-cache --force-remove --', rm_files):
+		raise GitException, 'Failed git-update-cache --rm'
+	if m_files:
+	    if __run('git-update-cache --', m_files):
+		raise GitException, 'Failed git-update-cache'
 
     # write the index to repository
     tree_id = __output('git-write-tree')
@@ -292,7 +326,7 @@ def merge(base, head1, head2):
     """Perform a 3-way merge between base, head1 and head2 into the
     local tree
     """
-    if os.system('git-read-tree -u -m %s %s %s' % (base, head1, head2)) != 0:
+    if __run('git-read-tree -u -m', [base, head1, head2]) != 0:
         raise GitException, 'git-read-tree failed (local changes maybe?)'
 
     # this can fail if there are conflicts
@@ -330,51 +364,31 @@ def status(files = [], modified = False,
         else:
             print '%s' % fs[1]
 
-def diff(files = [], rev1 = 'HEAD', rev2 = None, output = None,
-         append = False):
+def diff(files = [], rev1 = 'HEAD', rev2 = None, out_fd = sys.stdout):
     """Show the diff between rev1 and rev2
     """
-    files_str = reduce(lambda x, y: x + ' ' + y, files, '')
-
-    extra_args = ''
-    if output:
-        if append:
-            extra_args += ' >> %s' % output
-        else:
-            extra_args += ' > %s' % output
-
     os.system('git-update-cache --refresh > /dev/null')
 
     if rev2:
-        if os.system('git-diff-tree -p %s %s %s %s'
-                     % (rev1, rev2, files_str, extra_args)) != 0:
-            raise GitException, 'git-diff-tree failed'
+	nf, in_fd = os.popen2(['git-diff-tree', '-p', rev1, rev2]+files)
     else:
-        if os.system('git-diff-cache -p %s %s %s'
-                     % (rev1, files_str, extra_args)) != 0:
-            raise GitException, 'git-diff-cache failed'
+	nf, in_fd = os.popen2(['git-diff-cache', '-p', rev1]+files)
+    
+    out_fd.write(in_fd.read())
+    if in_fd.close() or nf.close():
+	raise GitException, 'git.diff failed'
 
 def diffstat(files = [], rev1 = 'HEAD', rev2 = None):
     """Return the diffstat between rev1 and rev2
     """
-    files_str = reduce(lambda x, y: x + ' ' + y, files, '')
 
     os.system('git-update-cache --refresh > /dev/null')
-    ds_cmd = '| git-apply --stat'
-
-    if rev2:
-        f = os.popen('git-diff-tree -p %s %s %s %s'
-                     % (rev1, rev2, files_str, ds_cmd), 'r')
-        str = f.read().rstrip()
-        if f.close():
-            raise GitException, 'git-diff-tree failed'
-    else:
-        f = os.popen('git-diff-cache -p %s %s %s'
-                     % (rev1, files_str, ds_cmd), 'r')
-        str = f.read().rstrip()
-        if f.close():
-            raise GitException, 'git-diff-cache failed'
-
+    ds_in, ds_out = os.popen2('git-apply --stat')
+    diff(files, rev1, rev2, ds_in)
+    ds_in.close()
+    str = ds_out.read().rstrip()
+    if ds_out.close():
+	raise GitException, 'git.diffstat failed'
     return str
 
 def files(rev1, rev2):
@@ -386,7 +400,7 @@ def files(rev1, rev2):
     f = os.popen('git-diff-tree -r %s %s' % (rev1, rev2),
                  'r')
     for line in f:
-        str += '%s %s\n' % tuple(line.split()[4:])
+        str += '%s %s\n' % tuple(line.rstrip().split(' ',4)[-1].split('\t',1))
     if f.close():
         raise GitException, 'git-diff-tree failed'
 
@@ -395,23 +409,23 @@ def files(rev1, rev2):
 def checkout(files = [], force = False):
     """Check out the given or all files
     """
-    git_flags = ''
+    git_flags = 'git-checkout-cache -q -u'
     if force:
         git_flags += ' -f'
     if len(files) == 0:
         git_flags += ' -a'
     else:
-        git_flags += reduce(lambda x, y: x + ' ' + y, files, ' --')
+	git_flags += ' --'
 
-    if os.system('git-checkout-cache -q -u%s' % git_flags) != 0:
-        raise GitException, 'Failed git-checkout-cache -q -u%s' % git_flags
+    if __run(git_flags, files) != 0:
+        raise GitException, 'Failed git-checkout-cache'
 
 def switch(tree_id):
     """Switch the tree to the given id
     """
     to_delete = filter(lambda x: x[0] == 'N', __tree_status(tree_id = tree_id))
 
-    if os.system('git-read-tree -m %s' % tree_id) != 0:
+    if __run('git-read-tree -m', [tree_id]) != 0:
         raise GitException, 'Failed git-read-tree -m %s' % tree_id
 
     checkout(force = True)
diff --git a/stgit/main.py b/stgit/main.py
--- a/stgit/main.py
+++ b/stgit/main.py
@@ -720,13 +720,13 @@ def export(parser, options, args):
                   'supported in the patch template'
         f = open(pfile, 'w+')
         f.write(descr)
-        f.close()
 
         # write the diff
-        git.diff(rev1 = __git_id('%s/bottom' % p),
+	git.diff(rev1 = __git_id('%s/bottom' % p),
                  rev2 = __git_id('%s/top' % p),
-                 output = pfile, append = True)
-        patch_no += 1
+                 out_fd = f)
+	f.close()
+	patch_no += 1
 
     series.close()
 

^ permalink raw reply

* Re: [PATCH] stgit: allow spaces in filenames
From: Catalin Marinas @ 2005-07-13 10:17 UTC (permalink / raw)
  To: Bryan Larsen; +Cc: bryan.larsen, git
In-Reply-To: <20050713083805.18461.87079.sendpatchset@bryan-larsens-ibook-g4.local>

Bryan Larsen <bryanlarsen@yahoo.com> wrote:
> The current version of stgit does not allow whitespace in filenames.
> This patch fixes that.  It also speeds up operations on large
> filesets considerably.

Thanks, I will apply it but I have a few comments below:

> +# __run: runs cmd using spawnvp.
> +#
> +#  The shell is avoided so it won't mess up our arguments.
> +# If args is very large, the command is run multiple times;
> +# args is split xargs style:  cmd is passed on each invocation.
> +# Unlike xargs, returns immediately if any non-zero return code 
> +# is received.
> +#
> +def __run(cmd, args=None):

I would prefer to add this as Python function documentation, i.e. with
"""...""" in the function body.

An additional thing, can you please convert all the tabs to spaces?
That's a better convention for a language like Python where you
delimit blocks by indentation.

> @@ -114,14 +132,16 @@ def __tree_status(files = [], tree_id = 
>      # unknown files
>      if unknown:
>          exclude_file = os.path.join(base_dir, 'exclude')
> -        extra_exclude = ''
> +        extra_exclude = []
>          if os.path.exists(exclude_file):
> -            extra_exclude += ' --exclude-from=%s' % exclude_file
> -        fout = os.popen('git-ls-files --others'
> -                        ' --exclude="*.[ao]" --exclude=".*"'
> -                        ' --exclude=TAGS --exclude=tags --exclude="*~"'
> -                        ' --exclude="#*"' + extra_exclude, 'r')
> +            extra_exclude.append('--exclude-from=%s' % exclude_file)
> +        fin, fout = os.popen2(['git-ls-files', '--others',
> +                        '--exclude=*.[ao]', '--exclude=.*'
> +                        '--exclude=TAGS', '--exclude=tags', '--exclude=*~',
> +                        '--exclude=#*'] + extra_exclude)
>          cache_files += [('?', line.strip()) for line in fout]
> +	fin.close()
> +	fout.close()

What's the reason for having 'fin' as well? It doesn't seem to be used
(this is found in other parts of the patch as well).

Something wrong happened to my git-ftp-push script. It looks like it
copied 'master' to stgit.git/ and not to stgit.git/refs/heads/. I
can't fix it until tonight. Before then, you could actually use wget
to pull the whole repository and just copy 'master' to
'refs/heads/master'. In the latest tree I created separate files for
each command.

I'm not sure whether the GIT guys are happy for us to use this mailing
list for StGIT. If the StGIT traffic increases, I will try to create a
separate mailing list (maybe using a site like sf.net).

-- 
Catalin

^ permalink raw reply

* Re: [ANNOUNCE] Cogito 0.12.1
From: Catalin Marinas @ 2005-07-13 11:13 UTC (permalink / raw)
  To: Russell King; +Cc: Petr Baudis, Linus Torvalds, git
In-Reply-To: <20050713081257.D19871@flint.arm.linux.org.uk>

Russell King <rmk@arm.linux.org.uk> wrote:
> I won't bother trying to explain, I'll just paste the errors.  We've been
> here before in a previous cogito revision.
>
> rmk@dyn-67:[linux-2.6-rmk]:<1038> cg-branch-ls
> origin  ../linux-2.6
> smp     ../linux-2.6-smp

I noticed that Cogito doesn't work well with relative paths. Run
cg-branch-chg and put absolute paths, it might work (it did for me).

-- 
Catalin

^ permalink raw reply

* Is cogito really this inefficient
From: Russell King @ 2005-07-13 12:50 UTC (permalink / raw)
  To: git

This says it all.  1min 22secs to generate a patch from a locally
modified but uncommitted file.

cp, edit, diff would be several orders of magnitude faster.  What's
going on?

$ /usr/bin/time cg-diff drivers/serial/8250.c > o
Command exited with non-zero status 1
14.40user 17.47system 1:22.96elapsed 38%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (180major+14692minor)pagefaults 0swaps

diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2333,6 +2333,7 @@ static int __devinit serial8250_probe(st
 			dev_err(dev, "unable to register port at index %d "
 				"(IO%lx MEM%lx IRQ%d): %d\n", i,
 				p->iobase, p->mapbase, p->irq, ret);
+			printk(KERN_ERR "uartclk was %d\n", port.uartclk);
 		}
 	}
 	return 0;

-- 
Russell King

^ permalink raw reply

* Re: [PATCH] stgit: allow spaces in filenames
From: Matthias Urlichs @ 2005-07-13 16:54 UTC (permalink / raw)
  To: git
In-Reply-To: <20050713083805.18461.87079.sendpatchset@bryan-larsens-ibook-g4.local>

Hi, Bryan Larsen wrote:

> +	r=os.spawnvp(os.P_WAIT, args_l[0], args_l + args[i:min(i+1000, len(args))])

The max length for argv is 32k IIRC, so 1000 is 28-byte file names.
That's probably not enough. I't suggest using chunks of 100.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Don't you feel more like you do now than you did when you came in?

^ permalink raw reply

* Re: Is cogito really this inefficient
From: Matthias Urlichs @ 2005-07-13 16:51 UTC (permalink / raw)
  To: git
In-Reply-To: <20050713135052.C6791@flint.arm.linux.org.uk>

Hi, Russell King wrote:

> This says it all.  1min 22secs to generate a patch from a locally
> modified but uncommitted file.

I only get that when the index is out-of-date WRT the file modification
dates, so cg-diff has to examine every file.

The good news is that the index is being updated as it finds that the
files are in sync, so expect this to be significantly faster the next time
around.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Praise the sea; on shore remain.
		-- John Florio

^ permalink raw reply

* GIT overlay repositories
From: James Ketrenos @ 2005-07-13 18:03 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 6010 bytes --]

Ok...

I started working on this a few weeks ago when it didn't appear 
anyone else had worked on support for this feature.  Since then, I
haven't kept pace with GIT development, so someone may have done 
something similar in the interim.  That said...

Start with two repositories, let's call them Repo-A and Repo-B.  Repo-A
is hosted on some server somewhere and contains lots of code 
(let's say its a kernel source repository).  Repo-B is only adding a 
small amount of changes to the repo (for argument sake, let's say the 
IPW2100 and IPW2200 projects) on top of what is already provided by Repo-A. 

For several reasons, we would like users to be able to get just the 
differences between Repo-A and Repo-B from me.

For example, the user gets the full Repo-A:

	rsync -avpr rsync://somewhere.com/repo-a/.git/objects/ \ 
		.git/objects/
	rsync -avpr rsync://somewhere.com/repo-a/.git/refs/heads/master \
		.git/refs/heads/parent

and then overlays just the delta, which they obtain from me:

	rsync -avpr rsync://myserver.com/repo-delta/.git/objects/ \
		.git/objects/
	rsync -avpr rsync://myserver.com/repo-delta/.git/refs/heads/master \
		.git/refs/heads/master

The user can then run:

	ln -s .git/HEAD refs/heads/master
	git-read-tree -m HEAD
	git-checkout-cache -a -q -f -u

And now their disk has the entire Repo-A + Repo-B object 
tree as if Repo-B had been entirely stored on myserver.com.

Adding this recursively is pretty straightforward if we introduce an 
'ancestors' file stored on the overlay repository that contains the URL 
and SHA of the tip of the parent when it was used to build the full 
repository.  For example:

% cat .git/refs/ancestors (edited to fit 80 columns)
rsync://rsync.kernel.org/...-2.6.git/#ieee80211	0c16...7f3
rsync://bughost.org/repos/ieee80211-delta/.git/ 5cb5...b84
rsync://bughost.org/repos/ipw-delta/.git/       f3ed...abe

A simple script (attached as 'git-grab-overlay') can then walk this 
ancestor file and pull down updates as needed from each of the parent 
repositories.

The process of creating the overlays is pretty straight forward (for 
simple cases anyway)

For example:

	A1   B  <-- HEAD SHA1
	|    |
	|    |
	| .->'  <-- parent SHA1
	|/     
	|
	A

In this state, the list of objects is easily obtained by walking the 
tree from HEAD back to the parent's SHA1 at the time the branch was 
made.  This can be done with something like: 

	git-rev-list --objects HEAD ^parent

To simplify things, I created the attached script 'git-make-overlay' 
which will create an overlay repository with for all objects needed 
between a given SHA1 and the HEAD of the repository:

	cd repository
	git-make-overlay ../target

This script will take the current HEAD and cached parent SHA (stored via 
the git-grab-overlay or manually when you create the intial tree) and 
create an overlay that you can then store on a remote server for others 
to pull.

Obviously you don't want the overlay repository to remain out of sync 
with the parent repository for too long.  The process of updating the 
full local repository is then a matter of:

  * Grabbing the latest parent objects
  * Caching the parent's latest master (store as new-parent)
  * Perform a merge of the child back into the master tree
  * Updating the cached heads (parent, master, etc.)

The merge is accomplished via:

	child=$(cat .git/HEAD)
	parent=$(cat .git/refs/heads/new-parent)
	base=$(git-merge-base $child $parent)
	# NOTE: base should be the same as .git/refs/heads/parent!

Is it best to merge the smaller subset back into the merge base, ie:

	git-read-tree -m $base $parent $child

In either case, the merge will fail if you have your local tree in a 
state consistent with child (vs. base).  So before you do the merge you 
need to either nuke the local tree or use paramters to the git- tools 
that I don't know about (definitely wouldn't suprise me).  When I run it, 
I create a temporary directory with a symlink of .git to the .git directory
where the merge will occur.  After the merge is done, I go back to the main
directory and resync the local file system with the GIT repository.

Anyway, I put together another simple script that attempts to do the 
above--minus the symlink hack (attached as git-merge-parent).  It invokes 
the git-merge-heads script which does some of what Cogito's cg-merge does, 
only with support for automatically launching an external merge conflict 
resolution program.  It relies on cogito's cg-Xmergefile so you need to 
have cogito to use git-merge-parent and git-merge-heads.
	
Frequently when remerging with a parent repository--especially one that 
may contain a version of the child within it, there will be merge 
conflicts.  The git-merge-parent accepts (well, requries) a MERGE 
environment variable to invoke as a merge conflict resolver.  If a 
conflict arrises, it will prompt if you want to resolve the merge, 
undo the update, or exit and allow you to finish the process manually.

If you chose to run the conflict editor, it will invoke it by providing 
three versions of the conflicting file:

1.  The base version (as captured in the tree identified 
    with git-merge-base on the parent and child) -- named FILE.base
2.  The parent version named FILE.parent
3.  The child version named FILE

After all merge conflicts have been manually updated, the 
git-merge-parent script will commit those changes, along with the rest 
of the merge, and move the child's HEAD to the new tree identity.  In 
addition it will cache the HEAD of the parent's merge.

I haven't really tested the whole merge extensiveloy; it has worked 
(more or less) with some simple parent updates I've done here.  However, 
it may be of use to some folks out there, and if others can take it 
forward beyond what I have, or merge the functionality into cogito (or 
wherever) great. 

I have a tree currently up that demonstrates the above in use.  
You can access it via:

  git-grab-overlay rsync://bughost.org/repos/ipw-delta/.git/ ipw-dev/

James




[-- Attachment #2: git-grab-overlay --]
[-- Type: text/plain, Size: 2877 bytes --]

#!/usr/bin/env bash
# Copyright (c) 2005, Intel Corporation, James Ketrenos

function die()
{
	ret=$1
	shift
	echo $@ >&2
	exit $ret
}

function pull-delta-repo()
{
	parent=$1

	if echo "$parent" | egrep -q "#"; then
		branch=$(echo $parent | sed -ne "s,.*#\(.*\),\1,p")
		parent=$(echo $parent | sed -ne "s,\([^#]*\).*,\1,")
	else
		branch=master
	fi
	echo "$parent" | grep -q "/\$" || parent="$parent/"

	mkdir -p ${dst}{refs/{heads,branches},objects}

	echo "Grabbing repo:"
	echo -en "\tparent..."
	rsync ${RSYNC_FLAGS} -ap ${parent}refs/heads/${branch} \
		${2}refs/heads/parent || 
		die 5 "Could not pull $parent $branch"
	echo "done."

	echo -en "\tancestors..."
	rsync ${RSYNC_FLAGS} -ap ${parent}refs/ancestors \
		${2}refs/ancestors || 
		die 5 "Could not pull $parent $branch"
	echo "done."

	cat ${2}refs/ancestors |
	while read url sha; do
		echo $url | grep "^#.*" && continue
		url=$(echo $url | sed -e "s,\([^#]*\).*,\1,")
		echo $url | grep -q "/\$" || url="$url/"
		dir=$(echo $sha | sed -ne "s#^\(..\).*#\1#p")
		obj=$(echo $sha | sed -ne "s#^..\(.*\)#\1#p")
		echo -e "Checking for updates on:\n\t$url\nfor\n\t$sha..."
		if [ ! -e ${2}objects/$dir/$obj ]; then
			echo "Updating objects from $url..."
			rsync ${RSYNC_FLAGS} -avpr \
				${url}objects/ \
				${2}objects/ ||
				die 6 "Could not pull objects from $url."
			echo "Updated."
		else
			echo "$url up to date."
		fi
	done || exit 1

	url=$parent
	sha=$(cat ${2}/refs/heads/parent)
	dir=$(echo $sha | sed -ne "s#^\(..\).*#\1#p")
	obj=$(echo $sha | sed -ne "s#^..\(.*\)#\1#p")
	if [ ! -e ${2}objects/$dir/$obj ]; then
		echo "Updating objects from $url..."
		rsync ${RSYNC_FLAGS} -avpr \
			${url}objects/ \
			${2}objects/ ||
		die 6 "Coult not pull objects from $url."
	else
		echo "$url up to date."
	fi

	echo -e "$parent\t$sha" >> ${2}refs/ancestors
	cp ${2}refs/heads/parent ${2}refs/heads/master
	ln -sf refs/heads/master ${2}HEAD
#	rsync ${RSYNC_FLAGS} -ap ${1}refs/branches ${2}refs/branches/
}

([ ! "$1" ] || [ ! "$2" ]) && echo \
"usage: git-grab-overlay src_delta_repo target_full_repo" && exit 1

src="${1}"
echo ${src} | grep -q "/\$" || src="${src}/"
echo ${src} | grep -q "\.git/\$" || src="${src}.git/"

dst="${2}"
echo ${dst} | grep -q "/\$" || dst="${dst}/"
echo ${dst} | grep -q "\.git/\$" || dst="${dst}.git/"
[ ! -d ${dst} ] && (mkdir -p ${dst} || die 5 "Error creating '${dst}'")
dst=`readlink -f ${dst}`/

pull-delta-repo $src $dst || exit 1

echo ""
echo "${2} now contains the full tree from ${1}."
echo -e "\nTo sync the files to the cache state, run:"
echo -e "\t% cd ${2}"
echo -e "\t% git-read-tree -m HEAD && git-checkout-cache -q -f -u -a"
while true; do
	read -p "Do you want to do this now? [Y/n] :" reply
	case $reply in
	"n")	exit 0
		;;
	"Y"|"y"|"")
		dir=$PWD
		cd ${2}
		git-read-tree -m HEAD
		git-checkout-cache -q -f -u -a
		cd $PWD
		exit 0
	esac
done

[-- Attachment #3: git-make-overlay --]
[-- Type: text/plain, Size: 2419 bytes --]

#!/usr/bin/env bash
# Copyright (c) 2005, Intel Corporation, James Ketrenos

function die()
{
	ret=$1
	shift
	echo -e $@>&2
	exit $ret
}


function copy-object()
{
        dir=$(echo $1 | sed -e 's#\(..\).*#\1/#')
        obj=$(echo $1 | sed -e 's#..\(.*\)#\1#')

        [ ! -e ${2}objects/${dir}${obj} ] && \
                return 1

        if [ -e ${3}objects/${dir}${obj} ]; then
		[ "$warn" ] && echo "$1 already exists in $3."
                return 0
	fi

        [ ! -d ${3}objects/${dir} ] && \
                (mkdir -p ${3}objects/${dir} || return 1)

        cp -a ${2}objects/${dir}${obj} ${3}objects/${dir} || return 1
}


[ "$1" ] ||
	die 1 \
"usage: git-make-overlay dst-repo [SHA1]\n\n"\
"Where dst-repo is the target directory to store the overlay\n"\
"repository and SHA1 is the 'base' of the tree you want to create the\n"\
"delta against.\n"\
"\n"\
"If not provided, the script will compute the merge base between\n"\
"the parent (.git/refs/heads/parent) and the current HEAD (which would\n"\
"typically be the same).\n"\
"\n"\
"For example:\n"\
"  % child=\$(cat .git/HEAD)\n"\
"  % parent=\$(cat .git/refs/heads/parent)\n"\
"  % git-make-overlay ../overlay \$(git-merge-base \$child \$parent)\n"\
"\n"\
"The resulting overlay will be populated with the following files:\n"\
"\n"\
"  .git/objects\t\tContaining all objects not contained in parent.\n"\
"  .git/refs/ancestors\tParental lineage to root repository.\n"\
"  .git/refs/heads/master\tSHA for the tip of this overlay.\n"\
"\n"

[ -d ".git" ] ||
	die 2 ".git repository not found."

dst=$1
echo $dst | grep -ne "/\$" || dst="$1/"
echo $dst | grep -ne "\.git/\$" || dst="${dst}.git/"
[ ! -d $dst ] && (mkdir -p $dst || die 3 "mkdir: error creating '$dst'")
shift

if [ "$1" ]; then 
	base="$1"
else 
	base="$(git-merge-base $(cat .git/HEAD) $(cat .git/refs/heads/parent))"
fi

head=$(cat .git/HEAD)

echo -e \
"Creating overlay from:\n"\
"\t$base ->\n"\
"\t\t$head (HEAD)\nin\n"\
"\t$dst\n"

(git-rev-list --objects $head ^$base ||
                die 2 "git-rev-list failed!") |
while read sha rest; do
	copy-object $sha .git/ $dst || 
		die 5 "copy-object failed on $sha!"
	type=$(git-cat-file -t $sha)
	echo -e "$sha\t$type\t$rest"
done

mkdir -p ${dst}refs/heads || die 5 "Error creating refs/heads"
cat .git/HEAD > ${dst}refs/heads/master
ln -sf refs/heads/master ${dst}HEAD
cp .git/refs/ancestors ${dst}refs/ancestors

echo "done."

[-- Attachment #4: git-merge-heads --]
[-- Type: text/plain, Size: 1497 bytes --]

#!/usr/bin/env bash
#
# Portions based on cg-merge Copyright (c) Petr Baudis, 2005
# Copyright (c) 2005, Intel Corporation, James Ketrenos

. ${COGITO_LIB:-/usr/lib/cogito/}cg-Xlib

function die()
{
	ret=$1
	shift
	echo $@ >&2
	exit $ret
}

([ "$1" ] && [ "$2" ]) || 
	die 1 "usage: git-merge-heads parent-sha1 child-sha1"

git-read-tree HEAD ||
	die 8 "Failed to read tree"

parent=$1
child=$2
base=$(git-merge-base $1 $2) || 
	die 2 "Failed to obtain common base for trees"

git-read-tree -m $base $parent $child ||
	die 3 "Failed to merge trees"

if ! git-merge-cache -o ${COGITO_LIB:-/usr/lib/cogito/}cg-Xmergefile -a; then
	git-resolve-conflicts ||
		die 4 "Failed to resolve conflicts"
fi

tree=$(git-write-tree) || 
	die 5 "Failed to write merged tree."

echo "Merge succeeded as tree $tree."

while true; do
	read -p "Do you wish to commit this tree? [y]n :" reply <&1
	case $reply in
	n)	break
		;;
	y|*)
		echo "Type your COMMIT message followed by CTRL-D:"
		commit=$(git-commit-tree $tree -p $parent -p $child) ||
			die 6 "Commit failed."
		echo "Commit succeeded as commit $commit."
		echo "Moving HEAD to $commit"
		echo $commit > .git/HEAD
		break
		;;
	esac
done

git-read-tree -m HEAD

while true; do
	read -p "Do you wish to update the files on disk to reflect repository? [y]n :" reply <&1
	case $reply in
	n)	break
		;;
	y|*)
		git-read-tree -m HEAD ||
			die 9 "Failed to read tree."

		git-checkout-cache -q -u -f -a ||
			die 7 "Checkout failed."

		break
		;;
	esac
done


[-- Attachment #5: git-merge-parent --]
[-- Type: text/plain, Size: 3085 bytes --]

#!/usr/bin/env bash
# Copyright (c) 2005, Intel Corporation, James Ketrenos

function die()
{
	ret=$1
	shift
	echo $@ >&2
	exit $ret
}

[ ! "$MERGE" ] && 
	die 1 "MERGE must be set to merge program (ie, export MERGE=kdiff3)"

parent=
branch=
function get_parent_and_branch()
{
	[ ! -e .git/refs/parent ] && return 1
	parent=$(cat .git/refs/parent)
	[ ! "$parent" ] && return 1

	if echo ${parent} | egrep -q "#"; then
		branch="refs/heads/"$(echo $parent | sed -ne "s,.*#\(.*\),\1,p")
		parent=$(echo $parent | sed -e "s,\([^#]*\).*,\1,")
	else
		branch="HEAD"
	fi

	echo $parent | grep "/\$" || parent="${parent}/"

	return 0
}

function merge_parent()
{
	[ -e ".git/refs/heads/repository.merge" ] && 
		die 9 "Prior merge failed and not un-done."

	repo=$1
	branch=$2
	echo $repo | grep "/\$" || repo="${repo}/"
#	First verify there are no uncommitted changes, then proceed...
#	(TODO: Add script commands for checking for uncommitted changes)
#
#	Obtain the parent's HEAD and store as .git/refs/heads/parent.tip and
#		.git/refs/heads/parent.merge
	echo "Checking for updates from ${repo}${branch}..."

	rsync ${RSYNC_FLAGS} -vpL ${repo}${branch} .git/refs/heads/parent.tip || return 1

	parent=$(cat .git/refs/heads/parent)
	new_parent=$(cat .git/refs/heads/parent.tip)
	echo $new_parent > .git/refs/heads/parent.merge || return 2

#	Check for an update; if no update, we're done
	[ "$parent" == "$new_parent" ] && return 0

	child=$(cat .git/HEAD)

#	Grab the latest objects from the parent
	echo "Pulling object files"
	rsync ${RSYNC_FLAGS} -avpr ${repo}objects/ .git/objects/ || return 3

#	Copy the current HEAD to .git/refs/heads/repository.merge
	echo "Caching HEAD in repository.merge"
	cp .git/HEAD .git/refs/heads/repository.merge || return 4


#	Update the GIT index
	echo "Setting local repository to mirror parent"
	echo $new_parent > .git/HEAD || return 5
	rm .git/index
	git-read-tree -m HEAD || return 6
#	git-checkout-cache -f -u -a

# 	At this point, our local repository is now a mirror of the 
#	parent repository.  

#	Merge and commit the repository changes back into the current parent
	echo "Merging child back into parent"
	git-merge-heads $new_parent $child || return 7

#	Update parent / repo index links
	mv -f .git/refs/heads/parent.tip .git/refs/heads/parent || return 12

	mv .git/refs/heads/repository.merge .git/refs/heads/pre-merge
	
	echo "Updating ancestors file..."
	url=$(cat .git/refs/parent)
	sed -i -e "s#$url\t$parent#$url\t$new_parent#g" \
		.git/refs/ancestors
	return 0
}

function merge_cleanup()
{
#	If any of the above fails, the repository should be changed back 
#	to its original state:
	
	rm -f .git/refs/heads/{parent,repository}.merge \
		.git/refs/heads/parent.tip || \
		return 1
	ln -sf refs/heads/master .git/HEAD || return 2
	git-read-tree -m HEAD || return 3
	git-checkout-files -q -f -u -a || return 4

	return 0
}

if ! get_parent_and_branch; then
#	merge_cleanup
	exit 1
fi

echo -e "Attempting merging with:\n\t$parent\n..."
merge_parent $parent $branch || 
	die 12 "Error merging parent."

rm -rf .git/merge*

exit 0

^ permalink raw reply

* Re: [PATCH] stgit: allow spaces in filenames
From: Bryan Larsen @ 2005-07-13 18:17 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: Bryan Larsen, git
In-Reply-To: <tnxll4bdn7b.fsf@arm.com>

Catalin Marinas wrote:
> An additional thing, can you please convert all the tabs to spaces?
> That's a better convention for a language like Python where you
> delimit blocks by indentation.

I would have hoped that emacs py-mode would "do the right thing". 
Anybody know how to make it do what Catalin wants?

> 
> 
>>+        fin, fout = os.popen2(['git-ls-files', '--others',
> 
> 
> What's the reason for having 'fin' as well? It doesn't seem to be used
> (this is found in other parts of the patch as well).

popen does not support bypassing the shell by using vectors of 
arguments.  Only popen2 and friends have this capability.

Unfortunate, yes.

> 
> I'm not sure whether the GIT guys are happy for us to use this mailing
> list for StGIT. If the StGIT traffic increases, I will try to create a
> separate mailing list (maybe using a site like sf.net).
> 

I'd very much like to stay on the same list.  By the same logic, cogito 
should have it's own list as well...

Bryan

^ permalink raw reply

* Re: [RFC PATCH] cogito --- don't overwrite metadata files in place (breaks CoW use)
From: Chris Wedgwood @ 2005-07-13 18:53 UTC (permalink / raw)
  To: Matthias Urlichs; +Cc: git
In-Reply-To: <pan.2005.07.13.07.03.26.398212@smurf.noris.de>

On Wed, Jul 13, 2005 at 09:03:26AM +0200, Matthias Urlichs wrote:

> You are ;-) the tree itsels is no symlinked, but HEAD points to
> refs/heads/<branch> by default.

Thanks for pointing that out.  I honestly never noticed that.

How about the following?

    echo_to_file() {
	local DEST="$2"
	local count=1
	local RET

	# follow symlinks until we run out or end up with something
	# dangling
	while [ -L "$DEST" ] ; do
	    local NLINK=`readlink "$DEST"`

	    if [ ! -e "$NLINK" ] ; then
		# dangling link, just poke as-is
		echo "$1" > "$DEST"
		return $?
	    fi

	    # follow link
	    if [ -L "$NLINK" ] ; then
		count=$(("$count" + 1))
		if [ "$count" -gt 5 ] ; then
		    echo "Too many symlinks when resolving $2" 1>&2
		    return 1
		fi
		DEST="$NLINK"
	    fi
	done

	# end up with a regular file
	local TMPFILE=`mktemp "$DEST.tmp-XXXXXXX"`
	echo "$1" > "$TMPFILE"
	RET="$?"
	mv -f "$TMPFILE" "$DEST"
	return "$RET"
    }


Obvious changes from last time are:

  - mark things local

  - follow links, bailing out if it takes too long

  - if the link is dangling, just use as-is

  - when doing the 'replace' at the end use -f because it's quite
    possible someone will have done cp -Rl ~otheruser/tree here and mv
    *might* bitch if the UID is different?

  - return (some) errors (just because, it's not like cogito checks
    for these)

^ permalink raw reply

* Re: [PATCH] stgit: allow spaces in filenames
From: Linus Torvalds @ 2005-07-13 19:51 UTC (permalink / raw)
  To: Matthias Urlichs; +Cc: git
In-Reply-To: <pan.2005.07.13.16.54.18.709929@smurf.noris.de>



On Wed, 13 Jul 2005, Matthias Urlichs wrote:
>
> Hi, Bryan Larsen wrote:
> 
> > +	r=os.spawnvp(os.P_WAIT, args_l[0], args_l + args[i:min(i+1000, len(args))])
> 
> The max length for argv is 32k IIRC, so 1000 is 28-byte file names.

I think 32k may be the posix-mandated minimum. Linux does 128kB, so 1000 
should likely be ok for most projects.

That said, xargs should do things like that right.

		Linus

^ permalink raw reply

* [PATCH] Clean up diff option descriptions.
From: Junio C Hamano @ 2005-07-13 19:52 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git
In-Reply-To: <loom.20050712T224801-163@post.gmane.org>

I got tired of maintaining almost duplicated descriptions in
diff-* brothers, both in usage string and documentation.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---

*** This comes after the "diff-stages -u" and "--name-only" patches.
*** I am in the process of a full sweep over Documentation/ and
*** program usage strings right now so you will see more patches
*** to Documentation/ area from me.

 Documentation/Makefile            |    2 +
 Documentation/diff-options.txt    |   53 +++++++++++++++++++++++++++++++++++++
 Documentation/git-diff-cache.txt  |   48 ++--------------------------------
 Documentation/git-diff-files.txt  |   44 +------------------------------
 Documentation/git-diff-stages.txt |   48 ++--------------------------------
 Documentation/git-diff-tree.txt   |   46 ++------------------------------
 diff-cache.c                      |    4 ++-
 diff-files.c                      |    4 ++-
 diff-stages.c                     |    3 +-
 diff-tree.c                       |    4 ++-
 diff.h                            |   20 ++++++++++++++
 11 files changed, 96 insertions(+), 180 deletions(-)
 create mode 100644 Documentation/diff-options.txt

6a3a580f9f9da9d5e821c2ffbe9d0dd1fe54cb63
diff --git a/Documentation/Makefile b/Documentation/Makefile
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -25,7 +25,7 @@ man1: $(DOC_MAN1)
 man7: $(DOC_MAN7)
 
 # 'include' dependencies
-git-diff-%.txt: diff-format.txt
+git-diff-%.txt: diff-format.txt diff-options.txt
 	touch $@
 
 clean:
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
new file mode 100644
--- /dev/null
+++ b/Documentation/diff-options.txt
@@ -0,0 +1,53 @@
+-p::
+	Generate patch (see section on generating patches)
+
+-u::
+	Synonym for "-p".
+
+-r::
+	Look recursivelly in subdirectories; this flag does not
+	mean anything to commands other than "git-diff-tree";
+	other commands always looks at all the subdirectories.
+
+-z::
+	\0 line termination on output
+
+--name-only::
+	Show only names of changed files.
+
+--name-only-z::
+	Same as --name-only, but terminate lines with NUL.
+
+-B::
+	Break complete rewrite changes into pairs of delete and create.
+
+-M::
+	Detect renames.
+
+-C::
+	Detect copies as well as renames.
+
+--find-copies-harder::
+	By default, -C option finds copies only if the original
+	file of the copy was modified in the same changeset for
+	performance reasons.  This flag makes the command
+	inspect unmodified files as candidates for the source of
+	copy.  This is a very expensive operation for large
+	projects, so use it with caution.
+
+-S<string>::
+	Look for differences that contains the change in <string>.
+
+--pickaxe-all::
+	When -S finds a change, show all the changes in that
+	changeset, not just the files that contains the change
+	in <string>.
+
+-O<orderfile>::
+	Output the patch in the order specified in the
+	<orderfile>, which has one shell glob pattern per line.
+
+-R::
+	Swap two inputs; that is, show differences from cache or
+	on-disk file to tree contents.
+
diff --git a/Documentation/git-diff-cache.txt b/Documentation/git-diff-cache.txt
--- a/Documentation/git-diff-cache.txt
+++ b/Documentation/git-diff-cache.txt
@@ -9,7 +9,7 @@ git-diff-cache - Compares content and mo
 
 SYNOPSIS
 --------
-'git-diff-cache' [-p] [-r] [-z] [-m] [--cached] [-R] [-B] [-M] [-C] [--find-copies-harder] [-O<orderfile>] [-S<string>] [--pickaxe-all] <tree-ish> [<path>...]
+'git-diff-cache' [-m] [--cached] [<common diff options>] <tree-ish> [<path>...]
 
 DESCRIPTION
 -----------
@@ -21,53 +21,11 @@ entries in the cache are compared.
 
 OPTIONS
 -------
+include::diff-options.txt[]
+
 <tree-ish>::
 	The id of a tree object to diff against.
 
--p::
-	Generate patch (see section on generating patches)
-
--r::
-	This flag does not mean anything.  It is there only to match
-	"git-diff-tree".  Unlike "git-diff-tree", "git-diff-cache"
-	always looks at all the subdirectories.
-
--z::
-	\0 line termination on output
-
--B::
-	Break complete rewrite changes into pairs of delete and create.
-
--M::
-	Detect renames.
-
--C::
-	Detect copies as well as renames.
-
---find-copies-harder::
-	By default, -C option finds copies only if the original
-	file of the copy was modified in the same changeset for
-	performance reasons.  This flag makes the command
-	inspect unmodified files as candidates for the source of
-	copy.  This is a very expensive operation for large
-	projects, so use it with caution.
-
--S<string>::
-	Look for differences that contains the change in <string>.
-
---pickaxe-all::
-	When -S finds a change, show all the changes in that
-	changeset, not just the files that contains the change
-	in <string>.
-
--O<orderfile>::
-	Output the patch in the order specified in the
-	<orderfile>, which has one shell glob pattern per line.
-
--R::
-	Swap two inputs; that is, show differences from cache or
-	on-disk file to tree contents.
-
 --cached::
 	do not consider the on-disk file at all
 
diff --git a/Documentation/git-diff-files.txt b/Documentation/git-diff-files.txt
--- a/Documentation/git-diff-files.txt
+++ b/Documentation/git-diff-files.txt
@@ -9,7 +9,7 @@ git-diff-files - Compares files in the w
 
 SYNOPSIS
 --------
-'git-diff-files' [-p] [-q] [-r] [-z] [-R] [-B] [-M] [-C] [--find-copies-harder] [-O<orderfile>] [-S<string>] [--pickaxe-all] [<path>...]
+'git-diff-files' [-q] [<common diff options>] [<path>...]
 
 DESCRIPTION
 -----------
@@ -20,51 +20,11 @@ same as "git-diff-cache" and "git-diff-t
 
 OPTIONS
 -------
--p::
-	generate patch (see section on generating patches).
+include::diff-options.txt[]
 
 -q::
 	Remain silent even on nonexisting files
 
--R::
-	Swap two inputs; that is, show differences from on-disk files
-	to cache contents.
-
--B::
-	Break complete rewrite changes into pairs of delete and create.
-
--M::
-	Detect renames.
-
--C::
-	Detect copies as well as renames.
-
---find-copies-harder::
-	By default, -C option finds copies only if the original
-	file of the copy was modified in the same changeset for
-	performance reasons.  This flag makes the command
-	inspect unmodified files as candidates for the source of
-	copy.  This is a very expensive operation for large
-	projects, so use it with caution.
-
--S<string>::
-	Look for differences that contains the change in <string>.
-
---pickaxe-all::
-	When -S finds a change, show all the changes in that
-	changeset, not just the files that contains the change
-	in <string>.
-
--O<orderfile>::
-	Output the patch in the order specified in the
-	<orderfile>, which has one shell glob pattern per line.
-
--r::
-	This flag does not mean anything.  It is there only to match
-	git-diff-tree.  Unlike git-diff-tree, git-diff-files always looks
-	at all the subdirectories.
-
-
 Output format
 -------------
 include::diff-format.txt[]
diff --git a/Documentation/git-diff-stages.txt b/Documentation/git-diff-stages.txt
--- a/Documentation/git-diff-stages.txt
+++ b/Documentation/git-diff-stages.txt
@@ -9,7 +9,7 @@ git-diff-stages - Compares content and m
 
 SYNOPSIS
 --------
-'git-diff-stages' [-p] [-r] [-z] [-R] [-B] [-M] [-C] [--find-copies-harder] [-O<orderfile>] [-S<string>] [--pickaxe-all] <stage1> <stage2> [<path>...]
+'git-diff-stages' [<common diff options>] <stage1> <stage2> [<path>...]
 
 DESCRIPTION
 -----------
@@ -18,53 +18,11 @@ unmerged index file.
 
 OPTIONS
 -------
+include::diff-options.txt[]
+
 <stage1>,<stage2>::
 	The stage number to be compared.
 
--p::
-	Generate patch (see section on generating patches)
-
--r::
-	This flag does not mean anything.  It is there only to match
-	"git-diff-tree".  Unlike "git-diff-tree", "git-diff-stages"
-	always looks at all the subdirectories.
-
--z::
-	\0 line termination on output
-
--B::
-	Break complete rewrite changes into pairs of delete and create.
-
--M::
-	Detect renames.
-
--C::
-	Detect copies as well as renames.
-
---find-copies-harder::
-	By default, -C option finds copies only if the original
-	file of the copy was modified in the same changeset for
-	performance reasons.  This flag makes the command
-	inspect unmodified files as candidates for the source of
-	copy.  This is a very expensive operation for large
-	projects, so use it with caution.
-
--S<string>::
-	Look for differences that contains the change in <string>.
-
---pickaxe-all::
-	When -S finds a change, show all the changes in that
-	changeset, not just the files that contains the change
-	in <string>.
-
--O<orderfile>::
-	Output the patch in the order specified in the
-	<orderfile>, which has one shell glob pattern per line.
-
--R::
-	Swap two inputs; that is, show differences from <stage2> to
-	<stage1>.
-
 Output format
 -------------
 include::diff-format.txt[]
diff --git a/Documentation/git-diff-tree.txt b/Documentation/git-diff-tree.txt
--- a/Documentation/git-diff-tree.txt
+++ b/Documentation/git-diff-tree.txt
@@ -9,7 +9,7 @@ git-diff-tree - Compares the content and
 
 SYNOPSIS
 --------
-'git-diff-tree' [-p] [-r] [-z] [--stdin] [-m] [-s] [-v] [-t] [-R] [-B] [-M] [-C] [--find-copies-harder] [-O<orderfile>] [-S<string>] [--pickaxe-all] <tree-ish> <tree-ish> [<path>...]
+'git-diff-tree' [--stdin] [-m] [-s] [-v] [--pretty] [-t] [<common diff options>] <tree-ish> <tree-ish> [<path>...]
 
 DESCRIPTION
 -----------
@@ -19,6 +19,8 @@ Note that "git-diff-tree" can use the tr
 
 OPTIONS
 -------
+include::diff-options.txt[]
+
 <tree-ish>::
 	The id of a tree object.
 
@@ -29,51 +31,9 @@ OPTIONS
 	Note that this parameter does not provide any wildcard or regexp
 	features.
 
--p::
-	generate patch (see section on generating patches).  For
-	git-diff-tree, this flag implies '-r' as well.
-
--B::
-	Break complete rewrite changes into pairs of delete and create.
-
--M::
-	Detect renames.
-
--C::
-	Detect copies as well as renames.
-
---find-copies-harder::
-	By default, -C option finds copies only if the original
-	file of the copy was modified in the same changeset for
-	performance reasons.  This flag makes the command
-	inspect unmodified files as candidates for the source of
-	copy.  This is a very expensive operation for large
-	projects, so use it with caution.
-
--R::
-	Swap two input trees.
-
--S<string>::
-	Look for differences that contains the change in <string>.
-
---pickaxe-all::
-	When -S finds a change, show all the changes in that
-	changeset, not just the files that contains the change
-	in <string>.
-
--O<orderfile>::
-	Output the patch in the order specified in the
-	<orderfile>, which has one shell glob pattern per line.
-
--r::
-	recurse
-
 -t::
 	show tree entry itself as well as subtrees.  Implies -r.
 
--z::
-	\0 line termination on output
-
 --root::
 	When '--root' is specified the initial commit will be showed as a big
 	creation event. This is equivalent to a diff against the NULL tree.
diff --git a/diff-cache.c b/diff-cache.c
--- a/diff-cache.c
+++ b/diff-cache.c
@@ -159,7 +159,9 @@ static void mark_merge_entries(void)
 }
 
 static char *diff_cache_usage =
-"git-diff-cache [-p] [-r] [-z] [-m] [--cached] [-R] [-B] [-M] [-C] [--find-copies-harder] [-O<orderfile>] [-S<string>] [--pickaxe-all] <tree-ish> [<path>...]";
+"git-diff-cache [-m] [--cached] "
+"[<common diff options>] <tree-ish> [<path>...]"
+COMMON_DIFF_OPTIONS_HELP;
 
 int main(int argc, const char **argv)
 {
diff --git a/diff-files.c b/diff-files.c
--- a/diff-files.c
+++ b/diff-files.c
@@ -7,7 +7,9 @@
 #include "diff.h"
 
 static const char *diff_files_usage =
-"git-diff-files [-p] [-q] [-r] [-z] [-R] [-B] [-M] [-C] [--find-copies-harder] [-O<orderfile>] [-S<string>] [--pickaxe-all] [<path>...]";
+"git-diff-files [-q] "
+"[<common diff options>] [<path>...]"
+COMMON_DIFF_OPTIONS_HELP;
 
 static int diff_output_format = DIFF_FORMAT_HUMAN;
 static int detect_rename = 0;
diff --git a/diff-stages.c b/diff-stages.c
--- a/diff-stages.c
+++ b/diff-stages.c
@@ -17,7 +17,8 @@ static const char *orderfile = NULL;
 static const char *diff_filter = NULL;
 
 static char *diff_stages_usage =
-"git-diff-stages [-p] [-r] [-z] [-R] [-B] [-M] [-C] [--find-copies-harder] [-O<orderfile>] [-S<string>] [--pickaxe-all] <stage1> <stage2> [<path>...]";
+"git-diff-stages [<common diff options>] <stage1> <stage2> [<path>...]"
+COMMON_DIFF_OPTIONS_HELP;
 
 static void diff_stages(int stage1, int stage2)
 {
diff --git a/diff-tree.c b/diff-tree.c
--- a/diff-tree.c
+++ b/diff-tree.c
@@ -395,7 +395,9 @@ static int diff_tree_stdin(char *line)
 }
 
 static char *diff_tree_usage =
-"git-diff-tree [-p] [-r] [-z] [--stdin] [-m] [-s] [-v] [--pretty] [-t] [-R] [-B] [-M] [-C] [--find-copies-header] [-O<orderfile>] [-S<string>] [--pickaxe-all] <tree-ish> <tree-ish>";
+"git-diff-tree [--stdin] [-m] [-s] [-v] [--pretty] [-t] "
+"[<common diff options>] <tree-ish> <tree-ish>"
+COMMON_DIFF_OPTIONS_HELP;
 
 int main(int argc, const char **argv)
 {
diff --git a/diff.h b/diff.h
--- a/diff.h
+++ b/diff.h
@@ -53,6 +53,26 @@ extern void diffcore_std_no_resolve(cons
 				    const char *pickaxe, int pickaxe_opts,
 				    const char *orderfile, const char *filter);
 
+#define COMMON_DIFF_OPTIONS_HELP \
+"\ncommon diff options:\n" \
+"  -r		diff recursively (only meaningful in diff-tree)\n" \
+"  -z		output diff-raw with lines terminated with NUL.\n" \
+"  -p		output patch format.\n" \
+"  -u		synonym for -p.\n" \
+"  --name-only	show only names of changed files.\n" \
+"  --name-only-z\n" \
+"		same as --name-only but terminate lines with NUL.\n" \
+"  -R		swap input file pairs.\n" \
+"  -B		detect complete rewrites.\n" \
+"  -M		detect renames.\n" \
+"  -C		detect copies.\n" \
+"  --find-copies-harder\n" \
+"		try unchanged files as candidate for copy detection.\n" \
+"  -O<file>	reorder diffs according to the <file>.\n" \
+"  -S<string>	find filepair whose only one side contains the string.\n" \
+"  --pickaxe-all\n" \
+"		show all files diff when -S is used and hit is found.\n"
+
 extern int diff_queue_is_empty(void);
 
 #define DIFF_FORMAT_HUMAN	0

^ permalink raw reply

* Re: [RFC PATCH] cogito --- don't overwrite metadata files in place (breaks CoW use)
From: Matthias Urlichs @ 2005-07-13 20:07 UTC (permalink / raw)
  To: Chris Wedgwood; +Cc: git
In-Reply-To: <20050713185339.GA9260@taniwha.stupidest.org>

Hi,

Chris Wedgwood:
> How about the following?
> 
Ummm...

> 	    local NLINK=`readlink "$DEST"`
> 
> 	    if [ ! -e "$NLINK" ] ; then

You lose if the link is relative and the symlink is not in the current
directory. You also lose on systems where the empty filename is
synonymous with the current directory.

You'd need to do something along the lines of

	if [ -n "$NLINK" ] ; then
		case "$NLINK" in
		/*) ;;
		*) NLINK="$(dirname "$DEST")/$NLINK" ;;
		esac
	fi

first.

> 		# dangling link, just poke as-is
> 		echo "$1" > "$DEST"

You should remove "DEST first. Otherwise, under Linux, you'll magically
create the file the symlink points to, which may not be what you want to
do.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Custom does often reason overrule And only serves for reason to the fool.
					-- John Wilmot, Earl of Rochester

^ permalink raw reply

* Re: [RFC PATCH] cogito --- don't overwrite metadata files in place (breaks CoW use)
From: Linus Torvalds @ 2005-07-13 20:05 UTC (permalink / raw)
  To: Chris Wedgwood; +Cc: Matthias Urlichs, Git Mailing List
In-Reply-To: <20050713185339.GA9260@taniwha.stupidest.org>



On Wed, 13 Jul 2005, Chris Wedgwood wrote:

> On Wed, Jul 13, 2005 at 09:03:26AM +0200, Matthias Urlichs wrote:
> 
> > You are ;-) the tree itsels is no symlinked, but HEAD points to
> > refs/heads/<branch> by default.
> 
> Thanks for pointing that out.  I honestly never noticed that.
> 
> How about the following?

This is really complicated, for no good reason.

The _object_ directories should be linked, but it's really wrong to link 
the "refs/" directories and expect them to have COW behaviour.

I've tried to make most of the git tools write the refs objects "safely" 
too, ie things like "git-receive-pack" (the receiving end of a 
"git-send-pack") will write the new ref to a lock-file and then do a 
"rename()" to set it. That is COW-safe, but the thing is, it's incredibly 
painful for many other operations, and I won't guarantee that git in 
general is always going to be COW-safe wrt all the git files.

For example, the "git clone -l" behaviour will _only_ link the objects 
subdirectory. The rest is copied. Unless there's a bug there somewhere.

		Linus

^ permalink raw reply

* [PATCH (contingency)] Document "curl" requirements.
From: Junio C Hamano @ 2005-07-13 20:11 UTC (permalink / raw)
  To: Darrin Thompson; +Cc: git
In-Reply-To: <20050713021240.88AAD63780@morimoto.progeny.com>

darrint@progeny.com (Darrin Thompson) writes:

> Cause setting environment variable GIT_SSL_NO_VERIFY to turn off
> curl's ssl peer verification.
>
> Only use curl for http transfers, instead of curl and wget.

I do not mind curl per se, since we already require libcurl for
http-pull, but it would be nice if we document what external
software we depend on in one place.  Something like this on top
of what you posted?

------------
Not just libcurl, but now we require curl executable as well.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
diff --git a/INSTALL b/INSTALL
--- a/INSTALL
+++ b/INSTALL
@@ -41,8 +41,10 @@ Issues of note:
 	  can avoid the bignum support by excising git-rev-list support
 	  for "--merge-order" (by hand).
 
-	- "libcurl".  git-http-pull uses this.  You can disable building of
-	  that program if you just want to get started. 
+	- "libcurl" and "curl" (executable).  git-http-pull and
+	  git-fetch-script use them.  If you do not use http
+	  transfer, you are probabaly OK if you do not have
+	  these two.
 
 	- "GNU diff" to generate patches.  Of course, you don't _have_ to
 	  generate patches if you don't want to, but let's face it, you'll

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox