<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/replace.c, branch v2.0.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.0.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.0.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-03-14T21:27:06Z</updated>
<entry>
<title>Merge branch 'mh/replace-refs-variable-rename'</title>
<updated>2014-03-14T21:27:06Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-03-14T21:27:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3e30cb0fbf83fd35c70e9697ba8871420d9fed0a'/>
<id>urn:sha1:3e30cb0fbf83fd35c70e9697ba8871420d9fed0a</id>
<content type='text'>
* mh/replace-refs-variable-rename:
  Document some functions defined in object.c
  Add docstrings for lookup_replace_object() and do_lookup_replace_object()
  rename read_replace_refs to check_replace_refs
</content>
</entry>
<entry>
<title>rename read_replace_refs to check_replace_refs</title>
<updated>2014-02-20T22:16:55Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2014-02-18T11:24:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=afc711b8e1ee89626f0dddf0ef01fb73168d47ca'/>
<id>urn:sha1:afc711b8e1ee89626f0dddf0ef01fb73168d47ca</id>
<content type='text'>
The semantics of this flag was changed in commit

    e1111cef23 inline lookup_replace_object() calls

but wasn't renamed at the time to minimize code churn.  Rename it now,
and add a comment explaining its use.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use wildmatch() directly without fnmatch() wrapper</title>
<updated>2014-02-20T22:15:46Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2014-02-15T02:01:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eb07894fe036566acccb71420ab79ccb9c9e2d66'/>
<id>urn:sha1:eb07894fe036566acccb71420ab79ccb9c9e2d66</id>
<content type='text'>
Make it clear that we don't use fnmatch() anymore.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>replace info: rename 'full' to 'long' and clarify in-code symbols</title>
<updated>2013-12-30T20:33:11Z</updated>
<author>
<name>Christian Couder</name>
<email>chriscool@tuxfamily.org</email>
</author>
<published>2013-12-28T11:00:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=663a8566beb5387530641abe71a8d8b2dafd08b3'/>
<id>urn:sha1:663a8566beb5387530641abe71a8d8b2dafd08b3</id>
<content type='text'>
Enum names SHORT/MEDIUM/FULL were too broad to be descriptive.  And
they clashed with built-in symbols on platforms like Windows.
Clarify by giving them REPLACE_FORMAT_ prefix.

Rename 'full' format in "git replace --format=&lt;name&gt;" to 'long', to
match others (i.e. 'short' and 'medium').

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/replace: unset read_replace_refs</title>
<updated>2013-12-12T19:53:49Z</updated>
<author>
<name>Christian Couder</name>
<email>chriscool@tuxfamily.org</email>
</author>
<published>2013-12-11T07:46:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=769a4fa463bb36ba78eb318f25e0e211f4fae949'/>
<id>urn:sha1:769a4fa463bb36ba78eb318f25e0e211f4fae949</id>
<content type='text'>
When checking to see if some objects are of the same type
and when displaying the type of objects, git replace uses
the sha1_object_info() function.

Unfortunately this function by default respects replace
refs, so instead of the type of a replaced object, it
gives the type of the replacement object which might
be different.

To fix this bug, and because git replace should work at a
level before replacement takes place, let's unset the
read_replace_refs global variable at the beginning of
cmd_replace().

Suggested-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/replace: teach listing using short, medium or full formats</title>
<updated>2013-12-12T19:53:49Z</updated>
<author>
<name>Christian Couder</name>
<email>chriscool@tuxfamily.org</email>
</author>
<published>2013-12-11T07:46:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=44f9f850e8ee6e2824ceb1855d836d484340edf7'/>
<id>urn:sha1:44f9f850e8ee6e2824ceb1855d836d484340edf7</id>
<content type='text'>
By default when listing replace refs, only the sha1 of the
replaced objects are shown.

In many cases, it is much nicer to be able to list all the
sha1 of the replaced objects along with the sha1 of the
replacment objects.

And in other cases it might be interesting to also show the
types of the replaced and replacement objects.

This patch introduce a new --format=&lt;fmt&gt; option where
&lt;fmt&gt; can be any of the following:

	'short': this is the same as when no --format
		option is used, that is only the sha1 of
		the replaced objects are shown
	'medium': this also lists the sha1 of the
		replacement objects
	'full': this shows the sha1 and the type of both
		the replaced and the replacement objects

Some documentation and some tests will follow.

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'cc/replace-with-the-same-type'</title>
<updated>2013-09-25T06:35:24Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2013-09-25T06:35:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=80f165a58a41ffd37ec24022db8e568bc5165075'/>
<id>urn:sha1:80f165a58a41ffd37ec24022db8e568bc5165075</id>
<content type='text'>
* cc/replace-with-the-same-type:
  Doc: 'replace' merge and non-merge commits
  t6050-replace: use some long option names
  replace: allow long option names
  Documentation/replace: add Creating Replacement Objects section
  t6050-replace: add test to clean up all the replace refs
  t6050-replace: test that objects are of the same type
  Documentation/replace: state that objects must be of the same type
  replace: forbid replacing an object with one of a different type
</content>
</entry>
<entry>
<title>Merge branch 'bk/refs-multi-update'</title>
<updated>2013-09-20T19:36:12Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-09-20T19:36:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9a86b899415c8a49cc33d6b43bcab8113ddca517'/>
<id>urn:sha1:9a86b899415c8a49cc33d6b43bcab8113ddca517</id>
<content type='text'>
Give "update-refs" a "--stdin" option to read multiple update
requests and perform them in an all-or-none fashion.

* bk/refs-multi-update:
  update-ref: add test cases covering --stdin signature
  update-ref: support multiple simultaneous updates
  refs: add update_refs for multiple simultaneous updates
  refs: add function to repack without multiple refs
  refs: factor delete_ref loose ref step into a helper
  refs: factor update_ref steps into helpers
  refs: report ref type from lock_any_ref_for_update
  reset: rename update_refs to reset_refs
</content>
</entry>
<entry>
<title>replace: allow long option names</title>
<updated>2013-09-06T20:32:24Z</updated>
<author>
<name>Christian Couder</name>
<email>chriscool@tuxfamily.org</email>
</author>
<published>2013-09-06T05:10:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ed0ff80984d37f9f40b1bf209bc86ea2fa8f3783'/>
<id>urn:sha1:ed0ff80984d37f9f40b1bf209bc86ea2fa8f3783</id>
<content type='text'>
It is now standard practice in Git to have both short and long option
names. So let's give a long option name to the git replace options too.

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>replace: forbid replacing an object with one of a different type</title>
<updated>2013-09-06T20:25:12Z</updated>
<author>
<name>Christian Couder</name>
<email>chriscool@tuxfamily.org</email>
</author>
<published>2013-09-06T05:10:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=277336a5e0341a5ae06fc330834dfeefe5e85cec'/>
<id>urn:sha1:277336a5e0341a5ae06fc330834dfeefe5e85cec</id>
<content type='text'>
Users replacing an object with one of a different type were not
prevented to do so, even if it was obvious, and stated in the doc,
that bad things would result from doing that.

To avoid mistakes, it is better to just forbid that though.

If -f option, which means '--force', is used, we can allow an object
to be replaced with one of a different type, as the user should know
what (s)he is doing.

If one object is replaced with one of a different type, the only way
to keep the history valid is to also replace all the other objects
that point to the replaced object. That's because:

* Annotated tags contain the type of the tagged object.

* The tree/parent lines in commits must be a tree and commits, resp.

* The object types referred to by trees are specified in the 'mode'
  field:
    100644 and 100755    blob
    160000               commit
    040000               tree
  (these are the only valid modes)

* Blobs don't point at anything.

The doc will be updated in a later patch.

Acked-by: Philip Oakley &lt;philipoakley@iee.org&gt;
Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
