<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/git.git/t/t4128-apply-root.sh, branch maint-1.7.12</title>
<subtitle>github.com: git/git.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/git.git/'/>
<entry>
<title>builtin-apply.c: pay attention to -p&lt;n&gt; when determining the name</title>
<updated>2009-11-27T03:02:24+00:00</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-11-25T10:56:54+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/git.git/commit/?id=ec7fc0b1a46c5a352532ea3f29c5663752fd8ac6'/>
<id>ec7fc0b1a46c5a352532ea3f29c5663752fd8ac6</id>
<content type='text'>
The patch structure has def_name component that is used to validate the
sanity of a "diff --git" patch by checking pathnames that appear on the
patch header lines for consistency.  The git_header_name() function is
used to compute this out of "diff --git a/... b/..." line, but the code
always stripped one level of prefix (i.e. "a/" and "b/"), without paying
attention to -p&lt;n&gt; option.  Code in find_name() function that parses other
lines in the patch header (e.g. "--- a/..." and "+++ b/..." lines) however
did strip the correct number of leading paths prefixes, and the sanity
check between these computed values failed.

Teach git_header_name() to honor -p&lt;n&gt; option like find_name() function
does.

Found and reported by Steven J. Murdoch who also wrote tests.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The patch structure has def_name component that is used to validate the
sanity of a "diff --git" patch by checking pathnames that appear on the
patch header lines for consistency.  The git_header_name() function is
used to compute this out of "diff --git a/... b/..." line, but the code
always stripped one level of prefix (i.e. "a/" and "b/"), without paying
attention to -p&lt;n&gt; option.  Code in find_name() function that parses other
lines in the patch header (e.g. "--- a/..." and "+++ b/..." lines) however
did strip the correct number of leading paths prefixes, and the sanity
check between these computed values failed.

Teach git_header_name() to honor -p&lt;n&gt; option like find_name() function
does.

Found and reported by Steven J. Murdoch who also wrote tests.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: shell negation portability fix</title>
<updated>2008-10-13T15:43:04+00:00</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2008-10-13T09:35:59+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/git.git/commit/?id=80bfd76af7ac817d4a4b9b7d54485076897c9a67'/>
<id>80bfd76af7ac817d4a4b9b7d54485076897c9a67</id>
<content type='text'>
Commit 969c8775 introduced a test which uses the non-portable construct:

  command1 &amp;&amp; ! command2 | command3

which must be

  command1 &amp;&amp; ! (command2 | command3)

to work on bsd shells (this is another example of bbf08124, which fixed
several similar cases).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 969c8775 introduced a test which uses the non-portable construct:

  command1 &amp;&amp; ! command2 | command3

which must be

  command1 &amp;&amp; ! (command2 | command3)

to work on bsd shells (this is another example of bbf08124, which fixed
several similar cases).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git apply --directory broken for new files</title>
<updated>2008-10-12T18:09:41+00:00</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2008-10-12T04:06:11+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/git.git/commit/?id=969c877506cf8cc760c7b251fef6c5b6850bfc19'/>
<id>969c877506cf8cc760c7b251fef6c5b6850bfc19</id>
<content type='text'>
We carefully verify that the input to git-apply is sane,
including cross-checking that the filenames we see in "+++"
headers match what was provided on the command line of "diff
--git". When --directory is used, however, we ended up
comparing the unadorned name to one with the prepended root,
causing us to complain about a mismatch.

We simply need to prepend the root directory, if any, when
pulling the name out of the git header.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Acked-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We carefully verify that the input to git-apply is sane,
including cross-checking that the filenames we see in "+++"
headers match what was provided on the command line of "diff
--git". When --directory is used, however, we ended up
comparing the unadorned name to one with the prepended root,
causing us to complain about a mismatch.

We simply need to prepend the root directory, if any, when
pulling the name out of the git header.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Acked-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>git-apply --directory: make --root more similar to GNU diff</title>
<updated>2008-07-07T02:33:08+00:00</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2008-07-07T01:36:01+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/git.git/commit/?id=f55638874774acc1e13a046353449ebc8734ab08'/>
<id>f55638874774acc1e13a046353449ebc8734ab08</id>
<content type='text'>
Applying a patch in the directory that is different from what the patch
records is done with --directory option in GNU diff.  The --root option we
introduced previously does the same, and we can call it the same way to
give users more familiar feel.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Applying a patch in the directory that is different from what the patch
records is done with --directory option in GNU diff.  The --root option we
introduced previously does the same, and we can call it the same way to
give users more familiar feel.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>apply --root: thinkofix.</title>
<updated>2008-07-02T22:28:22+00:00</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2008-07-02T22:28:22+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/git.git/commit/?id=8ee4a6c2ec6738cfbc815dc59e44825f2a9b9f15'/>
<id>8ee4a6c2ec6738cfbc815dc59e44825f2a9b9f15</id>
<content type='text'>
The end of a string is string[length-1], not string[length+1].
I pointed it out during the review, but I forgot about it when applying the
patch.  This should fix it.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The end of a string is string[length-1], not string[length+1].
I pointed it out during the review, but I forgot about it when applying the
patch.  This should fix it.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Teach "git apply" to prepend a prefix with "--root=&lt;root&gt;"</title>
<updated>2008-07-02T01:04:28+00:00</updated>
<author>
<name>Johannes Schindelin</name>
<email>Johannes.Schindelin@gmx.de</email>
</author>
<published>2008-06-30T23:44:47+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/git.git/commit/?id=c4730f35cc6507bc117a08885d88668fe02b1a7d'/>
<id>c4730f35cc6507bc117a08885d88668fe02b1a7d</id>
<content type='text'>
With "git apply --root=&lt;root&gt;", all file names in the patch are prepended
with &lt;root&gt;.  If a "-p" value was given, the paths are stripped _before_
prepending &lt;root&gt;.

Wished for by HPA.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With "git apply --root=&lt;root&gt;", all file names in the patch are prepended
with &lt;root&gt;.  If a "-p" value was given, the paths are stripped _before_
prepending &lt;root&gt;.

Wished for by HPA.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
