<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-remote-testgit.py, branch v1.7.11</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v1.7.11</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v1.7.11'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2012-04-24T21:54:24Z</updated>
<entry>
<title>git-remote-testgit: fix race when spawning fast-import</title>
<updated>2012-04-24T21:54:24Z</updated>
<author>
<name>Pete Wyckoff</name>
<email>pw@padd.com</email>
</author>
<published>2012-04-22T20:30:58Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=7fb8e163bdfdc5ffb69b98f3f05ef0dbade4e677'/>
<id>urn:sha1:7fb8e163bdfdc5ffb69b98f3f05ef0dbade4e677</id>
<content type='text'>
Test "pushing to local repo" in t5800-remote-helpers can hang
due to a race condition in git-remote-testgit.  Fix it by
setting stdin to unbuffered.

On the writer side, "git push" invokes push_refs_with_export(),
which sends to stdout the command "export\n" and immediately
starts up "git fast-export".  The latter writes its output stream
to the same stdout.

On the reader side, remote helper "git-remote-testgit" reads from
stdin to get its next command.  It uses getc() to read characters
from libc up until \n.  Libc has buffered a potentially much
larger chunk of stdin.  When it sees the "export\n" command, it
forks "git fast-import" to read the stream.

If fast-export finishes before git fast-import starts, the
fast-export output can end up in libc's buffer in
git-remote-testgit, rather than in git fast-import.  The latter
hangs indefinitely on a now-empty stdin.

Signed-off-by: Pete Wyckoff &lt;pw@padd.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>(short) documentation for the testgit remote helper</title>
<updated>2011-09-01T22:52:02Z</updated>
<author>
<name>Matthieu Moy</name>
<email>Matthieu.Moy@imag.fr</email>
</author>
<published>2011-09-01T16:49:38Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=9609dc9ddcb1a79112eb45c88244cdbb622bd5bc'/>
<id>urn:sha1:9609dc9ddcb1a79112eb45c88244cdbb622bd5bc</id>
<content type='text'>
While it's not a command meant to be used by actual users (hence, not
mentionned in git(1)), this command is a very precious help for
remote-helpers authors.

The best place for such technical doc is the source code, but users may
not find it without a link in a manpage.

Signed-off-by: Matthieu Moy &lt;Matthieu.Moy@imag.fr&gt;
Acked-by: Sverre Rabbelier &lt;srabbelier@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>transport-helper: implement marks location as capability</title>
<updated>2011-07-19T18:17:48Z</updated>
<author>
<name>Sverre Rabbelier</name>
<email>srabbelier@gmail.com</email>
</author>
<published>2011-07-16T13:03:40Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=a515ebe9f1ac9bc248c12a291dc008570de505ca'/>
<id>urn:sha1:a515ebe9f1ac9bc248c12a291dc008570de505ca</id>
<content type='text'>
Now that the gitdir location is exported as an environment variable
this can be implemented elegantly without requiring any explicit
flushes nor an ad-hoc exchange of values.

Signed-off-by: Sverre Rabbelier &lt;srabbelier@gmail.com&gt;
Acked-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>transport-helper: change import semantics</title>
<updated>2011-07-19T18:17:48Z</updated>
<author>
<name>Sverre Rabbelier</name>
<email>srabbelier@gmail.com</email>
</author>
<published>2011-07-16T13:03:38Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=9504bc9d5a1e672ce5945679f86294e61bbea3a6'/>
<id>urn:sha1:9504bc9d5a1e672ce5945679f86294e61bbea3a6</id>
<content type='text'>
Currently the helper must somehow guess how many import statements to
read before it starts outputting its fast-export stream. This is
because the remote helper infrastructure runs fast-import only once,
so the helper is forced to output one stream for all import commands
it will receive. The only reason this worked in the past was because
only one ref was imported at a time.

Change the semantics of the import statement such that it matches
that of the push statement. That is, the import statement is followed
by a series of import statements that are terminated by a '\n'.

Signed-off-by: Sverre Rabbelier &lt;srabbelier@gmail.com&gt;
Acked-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>transport-helper: update ref status after push with export</title>
<updated>2011-07-19T18:17:48Z</updated>
<author>
<name>Sverre Rabbelier</name>
<email>srabbelier@gmail.com</email>
</author>
<published>2011-07-16T13:03:37Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=6c8151a32e59c3109b3acc886358bfe6c14612fb'/>
<id>urn:sha1:6c8151a32e59c3109b3acc886358bfe6c14612fb</id>
<content type='text'>
Also add check_output from python 2.7.

Signed-off-by: Sverre Rabbelier &lt;srabbelier@gmail.com&gt;
Acked-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>transport-helper: use the new done feature where possible</title>
<updated>2011-07-19T18:17:48Z</updated>
<author>
<name>Sverre Rabbelier</name>
<email>srabbelier@gmail.com</email>
</author>
<published>2011-07-16T13:03:36Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=1f25c50419c5f46cd6b818438fe641cf942ee6ad'/>
<id>urn:sha1:1f25c50419c5f46cd6b818438fe641cf942ee6ad</id>
<content type='text'>
In other words, use fast-export --use-done-feature to add a 'done'
command at the end of streams passed to remote helpers' "import"
commands, and teach the remote helpers implementing "export" to use
the 'done' command in turn when producing their streams.

The trailing \n in the protocol signals the helper that the
connection is about to close, allowing it to do whatever cleanup
neccesary.

Previously, the connection would already be closed by the
time the trailing \n was to be written. Now that the remote-helper
protocol uses the new done command in its fast-import streams, this
is no longer the case and we can safely write the trailing \n.

Signed-off-by: Sverre Rabbelier &lt;srabbelier@gmail.com&gt;
Acked-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-remote-testgit: only push for non-local repositories</title>
<updated>2011-07-19T18:17:47Z</updated>
<author>
<name>Sverre Rabbelier</name>
<email>srabbelier@gmail.com</email>
</author>
<published>2011-07-16T13:03:30Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=0fb56ce716090248ed4895aff69dd3953b00882f'/>
<id>urn:sha1:0fb56ce716090248ed4895aff69dd3953b00882f</id>
<content type='text'>
Trying to push for local repositories will fail since there is no
local checkout in .git/info/... to push from as that is only used for
non-local repositories (local repositories are pushed to directly).

This went unnoticed because the transport helper infrastructure does
not check the return value of the helper.

Signed-off-by: Sverre Rabbelier &lt;srabbelier@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>remote-helpers: export GIT_DIR variable to helpers</title>
<updated>2011-07-19T18:17:47Z</updated>
<author>
<name>Dmitry Ivankov</name>
<email>divanorama@gmail.com</email>
</author>
<published>2011-07-16T13:03:28Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=e173587252ea0db16efc5c64c2cb165ccb406495'/>
<id>urn:sha1:e173587252ea0db16efc5c64c2cb165ccb406495</id>
<content type='text'>
The gitdir capability is recognized by git and can be used to tell
the helper where the .git directory is. But it is not mentioned in
the documentation and considered worse than if gitdir was passed
via GIT_DIR environment variable.

Remove support for the gitdir capability and export GIT_DIR instead.
Teach testgit to use env instead of the now-removed gitdir command.

[sr: fixed up documentation]

Signed-off-by: Dmitry Ivankov &lt;divanorama@gmail.com&gt;
Signed-off-by: Sverre Rabbelier &lt;srabbelier@gmail.com&gt;
Acked-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-remote-testgit: import non-HEAD refs</title>
<updated>2011-07-19T18:17:47Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2011-07-16T13:03:25Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=4e51ba238fb92ad732b4d34200fc8f53e29b333f'/>
<id>urn:sha1:4e51ba238fb92ad732b4d34200fc8f53e29b333f</id>
<content type='text'>
Upon receiving an "import" command, the testgit remote
helper would ignore the ref asked for by git and generate a
fast-export stream based on HEAD. Instead, we should
actually give git the ref it asked for.

This requires adding a new parameter to the export_repo
method in the remote-helpers python library, which may be
used by code outside of git.git. We use a default parameter
so that callers without the new parameter will get the same
behavior as before.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Sverre Rabbelier &lt;srabbelier@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Remove python 2.5'isms</title>
<updated>2010-06-14T03:02:50Z</updated>
<author>
<name>Brandon Casey</name>
<email>drafnel@gmail.com</email>
</author>
<published>2010-06-10T00:24:54Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=23b093ee087e99049585487f59e262a0e0662b6e'/>
<id>urn:sha1:23b093ee087e99049585487f59e262a0e0662b6e</id>
<content type='text'>
The following python 2.5 features were worked around:

    * the sha module is used as a fallback when the hashlib module is
      not available
    * the 'any' built-in method was replaced with a 'for' loop
    * a conditional expression was replaced with an 'if' statement
    * the subprocess.check_call method was replaced by a call to
      subprocess.Popen followed by a call to subprocess.wait with a
      check of its return status

These changes allow the python infrastructure to be used with python 2.4
which is distributed with RedHat's RHEL 5, for example.

t5800 was updated to check for python &gt;= 2.4 to reflect these changes.

Signed-off-by: Brandon Casey &lt;casey@nrlssc.navy.mil&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
