{"thread":{"id":"14240","subject":"[JGIT PATCH 0/8] Minor push fixups","startedAt":"2008-07-01T03:03:57Z","lastAt":"2008-07-01T03:04:05Z","messageCount":9,"participants":["Shawn O. Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":8},"messages":[{"id":"81831","messageId":"1214881445-3931-1-git-send-email-spearce@spearce.org","threadId":"14240","inReplyTo":null,"subject":"[JGIT PATCH 0/8] Minor push fixups","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-07-01T03:03:57Z","receivedAt":"2008-07-01T03:03:57Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"A (small by recent standards) series to fix some issues with push\nin both the dumb and smart transports.\n\nWe also can now package jgit as a stand-alone shell+JAR combination;\nI install this into my path and have been favoring it over C Git\nfor a few days now.\n\n--\n\nShawn O. Pearce (8):\n  Correct thin pack completion in IndexPack to handle some bundles\n  Delete reflog when deleting ref during dumb transport push\n  Refuse to create or delete funny ref names over dumb transports\n  Shorten progress message text from PackWriter\n  Correctly name the stderr redirection thread for local transport\n  Support 'git upload-pack' and 'git receive-pack' over SSH\n  Pack jgit into a portable single file command line utility\n  Don't try to pack 0{40} during push of delete and update\n\n .gitignore                                         |    1 +\n jgit                                               |   37 ----------------\n jgit.sh                                            |   45 ++++++++++++++++++++\n make_jgit.sh                                       |   26 +++++++++++\n .../src/org/spearce/jgit/lib/PackWriter.java       |    4 +-\n .../jgit/transport/BasePackPushConnection.java     |    6 ++-\n .../src/org/spearce/jgit/transport/IndexPack.java  |   11 ++++-\n .../spearce/jgit/transport/TransportGitSsh.java    |    8 +++-\n .../org/spearce/jgit/transport/TransportLocal.java |    6 +-\n .../spearce/jgit/transport/WalkPushConnection.java |   14 ++++++\n .../jgit/transport/WalkRemoteObjectDatabase.java   |   13 ++++++\n 11 files changed, 124 insertions(+), 47 deletions(-)\n create mode 100644 .gitignore\n delete mode 100755 jgit\n create mode 100755 jgit.sh\n create mode 100755 make_jgit.sh\n"},{"id":"81832","messageId":"1214881445-3931-2-git-send-email-spearce@spearce.org","threadId":"14240","inReplyTo":"1214881445-3931-1-git-send-email-spearce@spearce.org","subject":"[JGIT PATCH 1/8] Correct thin pack completion in IndexPack to handle some bundles","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-07-01T03:03:58Z","receivedAt":"2008-07-01T03:03:58Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Recently I saw a bundle with a chain of deltas to base objects as\nA->B->C, where A was the delta depending on the base B.  In this\npack all of the objects used OBJ_REF_DELTA to link to their base\nand C was not in the pack (it was assumed to be in the repository).\n\nBecause of the ordering of the ObjectIds for B and C jgit tried to\nresolve A's delta base by pulling from the repository, as B was not\nfound in the pack file.  The reason B was not found was because it\nwas waiting in the queue (to be processed next) and we did not know\nwhat B's ObjectId was.\n\nBy skipping objects whose ObjectLoader's aren't found we should be\nable to resolve those objects later when their delta base does get\nresolved in this pack.  However by the end of of this loop we must\nhave no more objects depending on something by ObjectId, as that is\nan indication that the local repository is missing the objects we\nmust have to complete this thin pack.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n .../src/org/spearce/jgit/transport/IndexPack.java  |   11 +++++++++--\n 1 files changed, 9 insertions(+), 2 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/IndexPack.java b/org.spearce.jgit/src/org/spearce/jgit/transport/IndexPack.java\nindex 24a0577..29d99db 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/transport/IndexPack.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/IndexPack.java\n@@ -55,6 +55,7 @@ import java.util.zip.Deflater;\n import java.util.zip.Inflater;\n \n import org.spearce.jgit.errors.CorruptObjectException;\n+import org.spearce.jgit.errors.MissingObjectException;\n import org.spearce.jgit.lib.BinaryDelta;\n import org.spearce.jgit.lib.Constants;\n import org.spearce.jgit.lib.InflaterCache;\n@@ -399,9 +400,10 @@ public class IndexPack {\n \n \t\tfinal Deflater def = new Deflater(Deflater.DEFAULT_COMPRESSION, false);\n \t\tlong end = packOut.length() - 20;\n-\t\twhile (!baseById.isEmpty()) {\n-\t\t\tfinal ObjectId baseId = baseById.keySet().iterator().next();\n+\t\tfor (final ObjectId baseId : new ArrayList<ObjectId>(baseById.keySet())) {\n \t\t\tfinal ObjectLoader ldr = repo.openObject(baseId);\n+\t\t\tif (ldr == null)\n+\t\t\t\tcontinue;\n \t\t\tfinal byte[] data = ldr.getBytes();\n \t\t\tfinal int typeCode = ldr.getType();\n \t\t\tfinal PackedObjectInfo oe;\n@@ -419,6 +421,11 @@ public class IndexPack {\n \t\t}\n \t\tdef.end();\n \n+\t\tif (!baseById.isEmpty()) {\n+\t\t\tfinal ObjectId need = baseById.keySet().iterator().next();\n+\t\t\tthrow new MissingObjectException(need, \"delta base\");\n+\t\t}\n+\n \t\tfixHeaderFooter();\n \t}\n \n-- \n1.5.6.74.g8a5e\n"},{"id":"81836","messageId":"1214881445-3931-3-git-send-email-spearce@spearce.org","threadId":"14240","inReplyTo":"1214881445-3931-2-git-send-email-spearce@spearce.org","subject":"[JGIT PATCH 2/8] Delete reflog when deleting ref during dumb transport push","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-07-01T03:03:59Z","receivedAt":"2008-07-01T03:03:59Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"If we remove a ref we must also remove the reflog.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n .../spearce/jgit/transport/WalkPushConnection.java |    7 +++++++\n .../jgit/transport/WalkRemoteObjectDatabase.java   |   13 +++++++++++++\n 2 files changed, 20 insertions(+), 0 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/WalkPushConnection.java b/org.spearce.jgit/src/org/spearce/jgit/transport/WalkPushConnection.java\nindex f63bedd..5450b84 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/transport/WalkPushConnection.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/WalkPushConnection.java\n@@ -280,6 +280,13 @@ class WalkPushConnection extends BaseConnection implements PushConnection {\n \t\t\t\tu.setMessage(e.getMessage());\n \t\t\t}\n \t\t}\n+\n+\t\ttry {\n+\t\t\tdest.deleteRefLog(u.getRemoteName());\n+\t\t} catch (IOException e) {\n+\t\t\tu.setStatus(Status.REJECTED_OTHER_REASON);\n+\t\t\tu.setMessage(e.getMessage());\n+\t\t}\n \t}\n \n \tprivate void updateCommand(final RemoteRefUpdate u) {\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/WalkRemoteObjectDatabase.java b/org.spearce.jgit/src/org/spearce/jgit/transport/WalkRemoteObjectDatabase.java\nindex 1e13b33..b99144a 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/transport/WalkRemoteObjectDatabase.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/WalkRemoteObjectDatabase.java\n@@ -269,6 +269,19 @@ abstract class WalkRemoteObjectDatabase {\n \t}\n \n \t/**\n+\t * Delete a reflog from the remote repository.\n+\t * \n+\t * @param name\n+\t *            name of the ref within the ref space, for example\n+\t *            <code>refs/heads/pu</code>.\n+\t * @throws IOException\n+\t *             deletion is not supported, or deletion failed.\n+\t */\n+\tvoid deleteRefLog(final String name) throws IOException {\n+\t\tdeleteFile(\"../logs/\" + name);\n+\t}\n+\n+\t/**\n \t * Overwrite (or create) a loose ref in the remote repository.\n \t * <p>\n \t * This method creates any missing parent directories, if necessary.\n-- \n1.5.6.74.g8a5e\n"},{"id":"81839","messageId":"1214881445-3931-4-git-send-email-spearce@spearce.org","threadId":"14240","inReplyTo":"1214881445-3931-3-git-send-email-spearce@spearce.org","subject":"[JGIT PATCH 3/8] Refuse to create or delete funny ref names over dumb transports","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-07-01T03:04:00Z","receivedAt":"2008-07-01T03:04:00Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"If the RemoteRefUpdate requests us to create a remote name of just\n\"master\" (say due to a bug in the push command line tool) we would do\njust that, creating \"$project.git/master\" on the remote side.  This is\nnot a valid ref for Git and confusion ensues when C Git tries to\noperate on the same repository.\n\nNormally these sorts of bad refs are blocked by git-receive-pack\non the remote side, but here we don't have that so we must do the\nblocking as part of the push connection.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n .../spearce/jgit/transport/WalkPushConnection.java |    7 +++++++\n 1 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/WalkPushConnection.java b/org.spearce.jgit/src/org/spearce/jgit/transport/WalkPushConnection.java\nindex 5450b84..e11b85a 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/transport/WalkPushConnection.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/WalkPushConnection.java\n@@ -129,6 +129,13 @@ class WalkPushConnection extends BaseConnection implements PushConnection {\n \t\t//\n \t\tfinal List<RemoteRefUpdate> updates = new ArrayList<RemoteRefUpdate>();\n \t\tfor (final RemoteRefUpdate u : refUpdates.values()) {\n+\t\t\tfinal String n = u.getRemoteName();\n+\t\t\tif (!n.startsWith(\"refs/\") || !Repository.isValidRefName(n)) {\n+\t\t\t\tu.setStatus(Status.REJECTED_OTHER_REASON);\n+\t\t\t\tu.setMessage(\"funny refname\");\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\n \t\t\tif (AnyObjectId.equals(ObjectId.zeroId(), u.getNewObjectId()))\n \t\t\t\tdeleteCommand(u);\n \t\t\telse\n-- \n1.5.6.74.g8a5e\n"},{"id":"81837","messageId":"1214881445-3931-5-git-send-email-spearce@spearce.org","threadId":"14240","inReplyTo":"1214881445-3931-4-git-send-email-spearce@spearce.org","subject":"[JGIT PATCH 4/8] Shorten progress message text from PackWriter","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-07-01T03:04:01Z","receivedAt":"2008-07-01T03:04:01Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"There are traditionally three phases to a pack algorithm:\n\n the enumeration phase, commonly called \"Counting objects\"\n the delta search phase, commonly called \"Compressing objects\"\n the output phase, commonly called \"Writing objects\"\n\nOur prior messages were too long for the text progress display\nand caused the progress meters to not line up vertically on the\nconsole.  The shorter (and more traditional) text does fit into\nthe column structure used by the text progress display.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n .../src/org/spearce/jgit/lib/PackWriter.java       |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java b/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java\nindex 9a427da..0439656 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/lib/PackWriter.java\n@@ -102,7 +102,7 @@ public class PackWriter {\n \t *\n \t * @see #preparePack(Collection, Collection, boolean, boolean)\n \t */\n-\tpublic static final String COUNTING_OBJECTS_PROGRESS = \"Counting objects to pack\";\n+\tpublic static final String COUNTING_OBJECTS_PROGRESS = \"Counting objects\";\n \n \t/**\n \t * Title of {@link ProgressMonitor} task used during searching for objects\n@@ -110,7 +110,7 @@ public class PackWriter {\n \t *\n \t * @see #writePack(OutputStream)\n \t */\n-\tpublic static final String SEARCHING_REUSE_PROGRESS = \"Searching for delta and object reuse\";\n+\tpublic static final String SEARCHING_REUSE_PROGRESS = \"Compressing objects\";\n \n \t/**\n \t * Title of {@link ProgressMonitor} task used during writing out pack\n-- \n1.5.6.74.g8a5e\n"},{"id":"81835","messageId":"1214881445-3931-6-git-send-email-spearce@spearce.org","threadId":"14240","inReplyTo":"1214881445-3931-5-git-send-email-spearce@spearce.org","subject":"[JGIT PATCH 5/8] Correctly name the stderr redirection thread for local transport","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-07-01T03:04:02Z","receivedAt":"2008-07-01T03:04:02Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"When we open git-receive-pack for the local transport case we still\ncreate a thread to redirect any error messages to the System.err\nconsole.  In this case the thread should be named after the command\nwe are running.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n .../org/spearce/jgit/transport/TransportLocal.java |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportLocal.java b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportLocal.java\nindex 761d1b8..b112267 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportLocal.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportLocal.java\n@@ -96,7 +96,7 @@ class TransportLocal extends PackTransport {\n \t\ttry {\n \t\t\tfinal Process proc = Runtime.getRuntime().exec(\n \t\t\t\t\tnew String[] { cmd, \".\" }, null, remoteGitDir);\n-\t\t\tnew StreamRewritingThread(proc.getErrorStream()).start();\n+\t\t\tnew StreamRewritingThread(cmd, proc.getErrorStream()).start();\n \t\t\treturn proc;\n \t\t} catch (IOException err) {\n \t\t\tthrow new TransportException(uri, err.getMessage(), err);\n@@ -158,8 +158,8 @@ class TransportLocal extends PackTransport {\n \tclass StreamRewritingThread extends Thread {\n \t\tprivate final InputStream in;\n \n-\t\tStreamRewritingThread(final InputStream in) {\n-\t\t\tsuper(\"JGit \" + getOptionUploadPack() + \" Errors\");\n+\t\tStreamRewritingThread(final String cmd, final InputStream in) {\n+\t\t\tsuper(\"JGit \" + cmd + \" Errors\");\n \t\t\tthis.in = in;\n \t\t}\n \n-- \n1.5.6.74.g8a5e\n"},{"id":"81838","messageId":"1214881445-3931-7-git-send-email-spearce@spearce.org","threadId":"14240","inReplyTo":"1214881445-3931-6-git-send-email-spearce@spearce.org","subject":"[JGIT PATCH 6/8] Support 'git upload-pack' and 'git receive-pack' over SSH","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-07-01T03:04:03Z","receivedAt":"2008-07-01T03:04:03Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Within the next 6 months C git clients will begin asking remote\nservers for 'git $command' rather than 'git-$command' when using the\nSSH transport.  This change is to allow the C git programs to be\nremoved from the user's $PATH, leaving only the git wrapper binary.\n\nFor the first 6 months after C git 1.6.0 gets released clients will\ncontinue to ask for 'git-$command' but users may change that behavior\nby specifically asking for 'git $command' in remote.$name.uploadpack\nor remote.$name.receivepack.  Later clients (including jgit) will\nchange to ask for 'git $command' by default.\n\nIf we are asking for 'git $command' we cannot quote this as a single\ncommand with a space in the path.  We split on the whitespace and\nquote both sides (if necessary) to protect the strings from the shell.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n .../spearce/jgit/transport/TransportGitSsh.java    |    8 +++++++-\n 1 files changed, 7 insertions(+), 1 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitSsh.java b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitSsh.java\nindex caf531d..1bbdf04 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitSsh.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/TransportGitSsh.java\n@@ -182,7 +182,13 @@ class TransportGitSsh extends PackTransport {\n \t\t\t\tpath = (uri.getPath().substring(1));\n \n \t\t\tfinal StringBuilder cmd = new StringBuilder();\n-\t\t\tsqMinimal(cmd, exe);\n+\t\t\tfinal int gitspace = exe.indexOf(\"git \");\n+\t\t\tif (gitspace >= 0) {\n+\t\t\t\tsqMinimal(cmd, exe.substring(0, gitspace + 3));\n+\t\t\t\tcmd.append(' ');\n+\t\t\t\tsqMinimal(cmd, exe.substring(gitspace + 4));\n+\t\t\t} else\n+\t\t\t\tsqMinimal(cmd, exe);\n \t\t\tcmd.append(' ');\n \t\t\tsqAlways(cmd, path);\n \t\t\tchannel.setCommand(cmd.toString());\n-- \n1.5.6.74.g8a5e\n"},{"id":"81833","messageId":"1214881445-3931-8-git-send-email-spearce@spearce.org","threadId":"14240","inReplyTo":"1214881445-3931-7-git-send-email-spearce@spearce.org","subject":"[JGIT PATCH 7/8] Pack jgit into a portable single file command line utility","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-07-01T03:04:04Z","receivedAt":"2008-07-01T03:04:04Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"On UNIX (and even Cygwin) we can package the entire jgit library into\na single JAR file and prefix that JAR with a shell script to start the\nJVM, passing in the script/JAR file as the only classpath.  This trick\nworks because the table of contents for the ZIP file is at the end of\nthe stream, and the JVM tends to only do random access through that\ntable when it looks up classes for loading.\n\nA tiny shell script called make_jgit.sh compiles everything with the\ncommand line javac and packages it into the portable jgit shell\nscript, making it possible to build and use jgit without touching\neither Eclipse or Maven.\n\nCurrently this is quite easy to implement as we have only one support\nlibrary (JSch), but things may get more complicated if we add another\nJAR to our classpath.\n\nWith this I can install JGit into my personal account and make use\nof it on a daily basis from the command line:\n\n\t./make_jgit.sh\n\tmv jgit ~/bin\n\tjgit push ...\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n .gitignore   |    1 +\n jgit         |   37 -------------------------------------\n jgit.sh      |   45 +++++++++++++++++++++++++++++++++++++++++++++\n make_jgit.sh |   26 ++++++++++++++++++++++++++\n 4 files changed, 72 insertions(+), 37 deletions(-)\n create mode 100644 .gitignore\n delete mode 100755 jgit\n create mode 100755 jgit.sh\n create mode 100755 make_jgit.sh\n\ndiff --git a/.gitignore b/.gitignore\nnew file mode 100644\nindex 0000000..0763732\n--- /dev/null\n+++ b/.gitignore\n@@ -0,0 +1 @@\n+/jgit\ndiff --git a/jgit b/jgit\ndeleted file mode 100755\nindex be7df7e..0000000\n--- a/jgit\n+++ /dev/null\n@@ -1,37 +0,0 @@\n-#!/bin/sh\n-\n-jgit_home=`dirname $0`\n-cp=\"$jgit_home/org.spearce.jgit/bin\"\n-cp=\"$cp:$jgit_home/org.spearce.jgit/lib/jsch-0.1.37.jar\"\n-unset jgit_home\n-java_args=\n-\n-# Cleanup paths for Cygwin.\n-#\n-case \"`uname`\" in\n-CYGWIN*)\n-\tcp=`cygpath --windows --mixed --path \"$cp\"`\n-\t;;\n-Darwin)\n-\tif test -e /System/Library/Frameworks/JavaVM.framework\n-\tthen\n-\t\tjava_args='\n-\t\t\t-Dcom.apple.mrj.application.apple.menu.about.name=JGit\n-\t\t\t-Dcom.apple.mrj.application.growbox.intrudes=false\n-\t\t\t-Dapple.laf.useScreenMenuBar=true\n-\t\t\t-Xdock:name=JGit\n-\t\t'\n-\tfi\n-\t;;\n-esac\n-\n-CLASSPATH=\"$cp\"\n-export CLASSPATH\n-\n-java=java\n-if test -n \"$JAVA_HOME\"\n-then\n-\tjava=\"$JAVA_HOME/bin/java\"\n-fi\n-\n-exec \"$java\" $java_args org.spearce.jgit.pgm.Main \"$@\"\ndiff --git a/jgit.sh b/jgit.sh\nnew file mode 100755\nindex 0000000..84927bc\n--- /dev/null\n+++ b/jgit.sh\n@@ -0,0 +1,45 @@\n+#!/bin/sh\n+\n+if [ \"@@use_self@@\" = \"1\" ]\n+then\n+\tthis_script=`which \"$0\" 2>/dev/null`\n+\t[ $? -gt 0 -a -f \"$0\" ] && this_script=\"$0\"\n+\tcp=$this_script\n+else\n+\tjgit_home=`dirname $0`\n+\tcp=\"$jgit_home/org.spearce.jgit/bin\"\n+\tcp=\"$cp:$jgit_home/org.spearce.jgit/lib/jsch-0.1.37.jar\"\n+\tunset jgit_home\n+\tjava_args=\n+fi\n+\n+# Cleanup paths for Cygwin.\n+#\n+case \"`uname`\" in\n+CYGWIN*)\n+\tcp=`cygpath --windows --mixed --path \"$cp\"`\n+\t;;\n+Darwin)\n+\tif test -e /System/Library/Frameworks/JavaVM.framework\n+\tthen\n+\t\tjava_args='\n+\t\t\t-Dcom.apple.mrj.application.apple.menu.about.name=JGit\n+\t\t\t-Dcom.apple.mrj.application.growbox.intrudes=false\n+\t\t\t-Dapple.laf.useScreenMenuBar=true\n+\t\t\t-Xdock:name=JGit\n+\t\t'\n+\tfi\n+\t;;\n+esac\n+\n+CLASSPATH=\"$cp\"\n+export CLASSPATH\n+\n+java=java\n+if test -n \"$JAVA_HOME\"\n+then\n+\tjava=\"$JAVA_HOME/bin/java\"\n+fi\n+\n+exec \"$java\" $java_args org.spearce.jgit.pgm.Main \"$@\"\n+exit 1\ndiff --git a/make_jgit.sh b/make_jgit.sh\nnew file mode 100755\nindex 0000000..3889dca\n--- /dev/null\n+++ b/make_jgit.sh\n@@ -0,0 +1,26 @@\n+#!/bin/sh\n+\n+PATH=$JAVA_HOME/bin:$PATH\n+O=jgit\n+T=\".temp$$.$O\"\n+\n+rm -f $O\n+rm -rf $T $O+ org.spearce.jgit/bin2\n+cp org.spearce.jgit/lib/jsch-0.1.37.jar $T &&\n+mkdir org.spearce.jgit/bin2 &&\n+(cd org.spearce.jgit/src &&\n+ find . -name \\*.java -type f |\n+ xargs javac \\\n+\t-source 1.5 \\\n+\t-target 1.5 \\\n+\t-g \\\n+\t-d ../bin2 \\\n+\t-cp ../lib/jsch-0.1.37.jar) &&\n+jar uf $T -C org.spearce.jgit/bin2 . &&\n+jar uf $T -C org.spearce.jgit META-INF &&\n+sed s/@@use_self@@/1/ jgit.sh >$O+ &&\n+cat $T >>$O+ &&\n+chmod 555 $O+ &&\n+mv $O+ $O &&\n+echo \"Created $O.\" &&\n+rm -rf $T $O+ org.spearce.jgit/bin2\n-- \n1.5.6.74.g8a5e\n"},{"id":"81834","messageId":"1214881445-3931-9-git-send-email-spearce@spearce.org","threadId":"14240","inReplyTo":"1214881445-3931-8-git-send-email-spearce@spearce.org","subject":"[JGIT PATCH 8/8] Don't try to pack 0{40} during push of delete and update","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-07-01T03:04:05Z","receivedAt":"2008-07-01T03:04:05Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"`jgit push origin :refs/heads/die refs/heads/master` tries to pack\n0{40} to delete branch \"die\" while also packing the objects needed\nto update branch master.  Since \"die\" is being removed we do not\nwant to pack any objects for it, as there is nothing to pack.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n .../jgit/transport/BasePackPushConnection.java     |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/BasePackPushConnection.java b/org.spearce.jgit/src/org/spearce/jgit/transport/BasePackPushConnection.java\nindex 7ae3aa7..784a578 100644\n--- a/org.spearce.jgit/src/org/spearce/jgit/transport/BasePackPushConnection.java\n+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/BasePackPushConnection.java\n@@ -169,8 +169,10 @@ class BasePackPushConnection extends BasePackConnection implements\n \n \t\tfor (final Ref r : getRefs())\n \t\t\tremoteObjects.add(r.getObjectId());\n-\t\tfor (final RemoteRefUpdate r : refUpdates.values())\n-\t\t\tnewObjects.add(r.getNewObjectId());\n+\t\tfor (final RemoteRefUpdate r : refUpdates.values()) {\n+\t\t\tif (!ObjectId.zeroId().equals(r.getNewObjectId()))\n+\t\t\t\tnewObjects.add(r.getNewObjectId());\n+\t\t}\n \n \t\twriter.preparePack(newObjects, remoteObjects, thinPack, true);\n \t\twriter.writePack(out);\n-- \n1.5.6.74.g8a5e\n"}]}