<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/convert.c, branch v2.15.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.15.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.15.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-09-22T03:49:57Z</updated>
<entry>
<title>consistently use "fallthrough" comments in switches</title>
<updated>2017-09-22T03:49:57Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-09-21T06:25:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1cf01a34eaccd6da613dba82291666db237916ab'/>
<id>urn:sha1:1cf01a34eaccd6da613dba82291666db237916ab</id>
<content type='text'>
Gcc 7 adds -Wimplicit-fallthrough, which can warn when a
switch case falls through to the next case. The general idea
is that the compiler can't tell if this was intentional or
not, so you should annotate any intentional fall-throughs as
such, leaving it to complain about any unannotated ones.

There's a GNU __attribute__ which can be used for
annotation, but of course we'd have to #ifdef it away on
non-gcc compilers. Gcc will also recognize
specially-formatted comments, which matches our current
practice. Let's extend that practice to all of the
unannotated sites (which I did look over and verify that
they were behaving as intended).

Ideally in each case we'd actually give some reasons in the
comment about why we're falling through, or what we're
falling through to. And gcc does support that with
-Wimplicit-fallthrough=2, which relaxes the comment pattern
matching to anything that contains "fallthrough" (or a
variety of spelling variants). However, this isn't the
default for -Wimplicit-fallthrough, nor for -Wextra. In the
name of simplicity, it's probably better for us to support
the default level, which requires "fallthrough" to be the
only thing in the comment (modulo some window dressing like
"else" and some punctuation; see the gcc manual for the
complete set of patterns).

This patch suppresses all warnings due to
-Wimplicit-fallthrough. We might eventually want to add that
to the DEVELOPER Makefile knob, but we should probably wait
until gcc 7 is more widely adopted (since earlier versions
will complain about the unknown warning type).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rs/strbuf-leakfix'</title>
<updated>2017-09-19T01:47:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-09-19T01:47:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d811ba1897b723fd0146875201061e3603c16391'/>
<id>urn:sha1:d811ba1897b723fd0146875201061e3603c16391</id>
<content type='text'>
Many leaks of strbuf have been fixed.

* rs/strbuf-leakfix: (34 commits)
  wt-status: release strbuf after use in wt_longstatus_print_tracking()
  wt-status: release strbuf after use in read_rebase_todolist()
  vcs-svn: release strbuf after use in end_revision()
  utf8: release strbuf on error return in strbuf_utf8_replace()
  userdiff: release strbuf after use in userdiff_get_textconv()
  transport-helper: release strbuf after use in process_connect_service()
  sequencer: release strbuf after use in save_head()
  shortlog: release strbuf after use in insert_one_record()
  sha1_file: release strbuf on error return in index_path()
  send-pack: release strbuf on error return in send_pack()
  remote: release strbuf after use in set_url()
  remote: release strbuf after use in migrate_file()
  remote: release strbuf after use in read_remote_branches()
  refs: release strbuf on error return in write_pseudoref()
  notes: release strbuf after use in notes_copy_from_stdin()
  merge: release strbuf after use in write_merge_heads()
  merge: release strbuf after use in save_state()
  mailinfo: release strbuf on error return in handle_boundary()
  mailinfo: release strbuf after use in handle_from()
  help: release strbuf on error return in exec_woman_emacs()
  ...
</content>
</entry>
<entry>
<title>Merge branch 'ma/ts-cleanups'</title>
<updated>2017-09-10T08:08:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-09-10T08:08:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a48ce378585054f2ae3b2f0e18346ab005290524'/>
<id>urn:sha1:a48ce378585054f2ae3b2f0e18346ab005290524</id>
<content type='text'>
Assorted bugfixes and clean-ups.

* ma/ts-cleanups:
  ThreadSanitizer: add suppressions
  strbuf_setlen: don't write to strbuf_slopbuf
  pack-objects: take lock before accessing `remaining`
  convert: always initialize attr_action in convert_attrs
</content>
</entry>
<entry>
<title>convert: release strbuf on error return in filter_buffer_or_fd()</title>
<updated>2017-09-06T23:49:27Z</updated>
<author>
<name>Rene Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-08-30T17:49:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f31f1d395131f84acbee14f42af8f702bca14468'/>
<id>urn:sha1:f31f1d395131f84acbee14f42af8f702bca14468</id>
<content type='text'>
Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tb/apply-with-crlf'</title>
<updated>2017-08-27T05:55:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-08-27T05:55:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a17483fcfe313e9ff5b9b0eb8245605fe7f66ea7'/>
<id>urn:sha1:a17483fcfe313e9ff5b9b0eb8245605fe7f66ea7</id>
<content type='text'>
"git apply" that is used as a better "patch -p1" failed to apply a
taken from a file with CRLF line endings to a file with CRLF line
endings.  The root cause was because it misused convert_to_git()
that tried to do "safe-crlf" processing by looking at the index
entry at the same path, which is a nonsense---in that mode, "apply"
is not working on the data in (or derived from) the index at all.
This has been fixed.

* tb/apply-with-crlf:
  apply: file commited with CRLF should roundtrip diff and apply
  convert: add SAFE_CRLF_KEEP_CRLF
</content>
</entry>
<entry>
<title>convert: always initialize attr_action in convert_attrs</title>
<updated>2017-08-23T17:14:19Z</updated>
<author>
<name>Martin Ågren</name>
<email>martin.agren@gmail.com</email>
</author>
<published>2017-08-21T17:43:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5c94c93d504e29c2099200a68926a34072cf2736'/>
<id>urn:sha1:5c94c93d504e29c2099200a68926a34072cf2736</id>
<content type='text'>
convert_attrs contains an "if-else". In the "if", we set attr_action
twice, and the first assignment has no effect. In the "else", we do not
set it at all. Since git_check_attr always returns the same value, we'll
always end up in the "if", so there is no problem right now. But
convert_attrs is obviously trying not to rely on such an
implementation-detail of another component.

Make the initialization of attr_action after the if-else. Remove the
earlier assignments.

Suggested-by: Torsten Bögershausen &lt;tboegi@web.de&gt;
Signed-off-by: Martin Ågren &lt;martin.agren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>convert: add SAFE_CRLF_KEEP_CRLF</title>
<updated>2017-08-16T17:21:17Z</updated>
<author>
<name>Torsten Bögershausen</name>
<email>tboegi@web.de</email>
</author>
<published>2017-08-13T08:51:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2fea9de61857986431982ae89c01c89a2fc10038'/>
<id>urn:sha1:2fea9de61857986431982ae89c01c89a2fc10038</id>
<content type='text'>
When convert_to_git() is called, the caller may want to keep CRLF to
be kept as CRLF (and not converted into LF).

This will be used in the next commit, when apply works with files
that have CRLF and patches are applied onto these files.

Add the new value "SAFE_CRLF_KEEP_CRLF" to safe_crlf.

Prepare convert_to_git() to be able to run the clean filter, skip
the CRLF conversion and run the ident filter.

Signed-off-by: Torsten Bögershausen &lt;tboegi@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jt/subprocess-handshake'</title>
<updated>2017-08-11T20:27:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-08-11T20:27:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9a8ff899cea20d88f6e1e7282b1ea64d964fc2e5'/>
<id>urn:sha1:9a8ff899cea20d88f6e1e7282b1ea64d964fc2e5</id>
<content type='text'>
Code cleanup.

* jt/subprocess-handshake:
  sub-process: refactor handshake to common function
  Documentation: migrate sub-process docs to header
</content>
</entry>
<entry>
<title>Merge branch 'sb/hashmap-cleanup'</title>
<updated>2017-08-11T20:27:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-08-11T20:27:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=55c965f3a27b3a36f84c56b6eba8ac5c95ff558a'/>
<id>urn:sha1:55c965f3a27b3a36f84c56b6eba8ac5c95ff558a</id>
<content type='text'>
Many uses of comparision callback function the hashmap API uses
cast the callback function type when registering it to
hashmap_init(), which defeats the compile time type checking when
the callback interface changes (e.g. gaining more parameters).
The callback implementations have been updated to take "void *"
pointers and cast them to the type they expect instead.

* sb/hashmap-cleanup:
  t/helper/test-hashmap: use custom data instead of duplicate cmp functions
  name-hash.c: drop hashmap_cmp_fn cast
  submodule-config.c: drop hashmap_cmp_fn cast
  remote.c: drop hashmap_cmp_fn cast
  patch-ids.c: drop hashmap_cmp_fn cast
  convert/sub-process: drop cast to hashmap_cmp_fn
  config.c: drop hashmap_cmp_fn cast
  builtin/describe: drop hashmap_cmp_fn cast
  builtin/difftool.c: drop hashmap_cmp_fn cast
  attr.c: drop hashmap_cmp_fn cast
</content>
</entry>
<entry>
<title>Merge branch 'ls/filter-process-delayed'</title>
<updated>2017-08-11T20:27:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-08-11T20:27:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=51b8aecabed1363f13c990320a50e1fb2aa3f696'/>
<id>urn:sha1:51b8aecabed1363f13c990320a50e1fb2aa3f696</id>
<content type='text'>
The filter-process interface learned to allow a process with long
latency give a "delayed" response.

* ls/filter-process-delayed:
  convert: add "status=delayed" to filter process protocol
  convert: refactor capabilities negotiation
  convert: move multiple file filter error handling to separate function
  convert: put the flags field before the flag itself for consistent style
  t0021: write "OUT &lt;size&gt;" only on success
  t0021: make debug log file name configurable
  t0021: keep filter log files on comparison
</content>
</entry>
</feed>
