<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/patch-ids.c, branch v2.16.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.16.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.16.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-11-01T02:51:40Z</updated>
<entry>
<title>diff: make struct diff_flags members lowercase</title>
<updated>2017-11-01T02:51:40Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-10-31T18:19:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0d1e0e7801bb2ae22036ad09f9f5cec17e08c48b'/>
<id>urn:sha1:0d1e0e7801bb2ae22036ad09f9f5cec17e08c48b</id>
<content type='text'>
Now that the flags stored in struct diff_flags are being accessed
directly and not through macros, change all struct members from being
uppercase to lowercase.
This conversion is done using the following semantic patch:

	@@
	expression E;
	@@
	- E.RECURSIVE
	+ E.recursive

	@@
	expression E;
	@@
	- E.TREE_IN_RECURSIVE
	+ E.tree_in_recursive

	@@
	expression E;
	@@
	- E.BINARY
	+ E.binary

	@@
	expression E;
	@@
	- E.TEXT
	+ E.text

	@@
	expression E;
	@@
	- E.FULL_INDEX
	+ E.full_index

	@@
	expression E;
	@@
	- E.SILENT_ON_REMOVE
	+ E.silent_on_remove

	@@
	expression E;
	@@
	- E.FIND_COPIES_HARDER
	+ E.find_copies_harder

	@@
	expression E;
	@@
	- E.FOLLOW_RENAMES
	+ E.follow_renames

	@@
	expression E;
	@@
	- E.RENAME_EMPTY
	+ E.rename_empty

	@@
	expression E;
	@@
	- E.HAS_CHANGES
	+ E.has_changes

	@@
	expression E;
	@@
	- E.QUICK
	+ E.quick

	@@
	expression E;
	@@
	- E.NO_INDEX
	+ E.no_index

	@@
	expression E;
	@@
	- E.ALLOW_EXTERNAL
	+ E.allow_external

	@@
	expression E;
	@@
	- E.EXIT_WITH_STATUS
	+ E.exit_with_status

	@@
	expression E;
	@@
	- E.REVERSE_DIFF
	+ E.reverse_diff

	@@
	expression E;
	@@
	- E.CHECK_FAILED
	+ E.check_failed

	@@
	expression E;
	@@
	- E.RELATIVE_NAME
	+ E.relative_name

	@@
	expression E;
	@@
	- E.IGNORE_SUBMODULES
	+ E.ignore_submodules

	@@
	expression E;
	@@
	- E.DIRSTAT_CUMULATIVE
	+ E.dirstat_cumulative

	@@
	expression E;
	@@
	- E.DIRSTAT_BY_FILE
	+ E.dirstat_by_file

	@@
	expression E;
	@@
	- E.ALLOW_TEXTCONV
	+ E.allow_textconv

	@@
	expression E;
	@@
	- E.TEXTCONV_SET_VIA_CMDLINE
	+ E.textconv_set_via_cmdline

	@@
	expression E;
	@@
	- E.DIFF_FROM_CONTENTS
	+ E.diff_from_contents

	@@
	expression E;
	@@
	- E.DIRTY_SUBMODULES
	+ E.dirty_submodules

	@@
	expression E;
	@@
	- E.IGNORE_UNTRACKED_IN_SUBMODULES
	+ E.ignore_untracked_in_submodules

	@@
	expression E;
	@@
	- E.IGNORE_DIRTY_SUBMODULES
	+ E.ignore_dirty_submodules

	@@
	expression E;
	@@
	- E.OVERRIDE_SUBMODULE_CONFIG
	+ E.override_submodule_config

	@@
	expression E;
	@@
	- E.DIRSTAT_BY_LINE
	+ E.dirstat_by_line

	@@
	expression E;
	@@
	- E.FUNCCONTEXT
	+ E.funccontext

	@@
	expression E;
	@@
	- E.PICKAXE_IGNORE_CASE
	+ E.pickaxe_ignore_case

	@@
	expression E;
	@@
	- E.DEFAULT_FOLLOW_RENAMES
	+ E.default_follow_renames

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff: remove DIFF_OPT_SET macro</title>
<updated>2017-11-01T02:50:03Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-10-31T18:19:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=23dcf77f48feb49c54bad09210f093a799816334'/>
<id>urn:sha1:23dcf77f48feb49c54bad09210f093a799816334</id>
<content type='text'>
Remove the `DIFF_OPT_SET` macro and instead set the flags directly.
This conversion is done using the following semantic patch:

	@@
	expression E;
	identifier fld;
	@@
	- DIFF_OPT_SET(&amp;E, fld)
	+ E.flags.fld = 1

	@@
	type T;
	T *ptr;
	identifier fld;
	@@
	- DIFF_OPT_SET(ptr, fld)
	+ ptr-&gt;flags.fld = 1

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>patch-ids.c: drop hashmap_cmp_fn cast</title>
<updated>2017-07-05T20:53:12Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2017-07-01T00:28:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8d0017daa1dcd596a1412700aee378c27238319e'/>
<id>urn:sha1:8d0017daa1dcd596a1412700aee378c27238319e</id>
<content type='text'>
Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>patch-ids.c: use hashmap correctly</title>
<updated>2017-06-30T20:11:54Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2017-06-30T19:14:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3da492f8088413c9db2da6c489e117d4808859e9'/>
<id>urn:sha1:3da492f8088413c9db2da6c489e117d4808859e9</id>
<content type='text'>
As alluded to in the previous patch, the code in patch-ids.c is
using the hashmaps API wrong.

Luckily we do not have a bug, as all hashmap functionality that we use
here (hashmap_get) passes through the keydata.  If hashmap_get_next were
to be used, a bug would occur as that passes NULL for the key_data.

So instead use the hashmap API correctly and provide the caller required
data in the compare function via the first argument that always gets
passed and was setup via the hashmap_init function.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>hashmap.h: compare function has access to a data field</title>
<updated>2017-06-30T19:49:28Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2017-06-30T19:14:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7663cdc86c860d5b5293a1dd4b0fb6c4e006d08e'/>
<id>urn:sha1:7663cdc86c860d5b5293a1dd4b0fb6c4e006d08e</id>
<content type='text'>
When using the hashmap a common need is to have access to caller provided
data in the compare function. A couple of times we abuse the keydata field
to pass in the data needed. This happens for example in patch-ids.c.

This patch changes the function signature of the compare function
to have one more void pointer available. The pointer given for each
invocation of the compare function must be defined in the init function
of the hashmap and is just passed through.

Documentation of this new feature is deferred to a later patch.
This is a rather mechanical conversion, just adding the new pass-through
parameter.  However while at it improve the naming of the fields of all
compare functions used by hashmaps by ensuring unused parameters are
prefixed with 'unused_' and naming the parameters what they are (instead
of 'unused' make it 'unused_keydata').

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff-tree: convert diff_tree_sha1 to struct object_id</title>
<updated>2017-06-05T02:23:58Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-05-30T17:31:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=66f414f885aa6f44ae9e764bdd3e3cd7bd80c5a3'/>
<id>urn:sha1:66f414f885aa6f44ae9e764bdd3e3cd7bd80c5a3</id>
<content type='text'>
Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tree-diff: convert diff_root_tree_sha1 to struct object_id</title>
<updated>2017-06-02T00:36:30Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-05-30T17:30:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7b8dea0c7570a2028f204498c82c8ca7ec6950e3'/>
<id>urn:sha1:7b8dea0c7570a2028f204498c82c8ca7ec6950e3</id>
<content type='text'>
Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff: convert diff_flush_patch_id to struct object_id</title>
<updated>2017-06-02T00:36:07Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-05-30T17:30:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bd25f288767aa26f42ac02d2d36695c8df9134dd'/>
<id>urn:sha1:bd25f288767aa26f42ac02d2d36695c8df9134dd</id>
<content type='text'>
Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>patch-ids: convert to struct object_id</title>
<updated>2017-06-02T00:36:07Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-05-30T17:30:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=34f3c0ebfbe3c8075587e5b06d0fd280ea57f053'/>
<id>urn:sha1:34f3c0ebfbe3c8075587e5b06d0fd280ea57f053</id>
<content type='text'>
Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>add_commit_patch_id(): avoid allocating memory unnecessarily</title>
<updated>2017-05-08T03:18:19Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2017-05-04T13:55:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5748693b9123f55363211d18e8074db5e1b8384e'/>
<id>urn:sha1:5748693b9123f55363211d18e8074db5e1b8384e</id>
<content type='text'>
It would appear that we allocate (and forget to release) memory if the
patch ID is not even defined.

Reported by the Coverity tool.

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