<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/ref-filter.c, branch v2.29.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.29.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.29.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-10-05T21:01:52Z</updated>
<entry>
<title>Merge branch 'ma/worktree-cleanups'</title>
<updated>2020-10-05T21:01:52Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-10-05T21:01:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=07601b5b360264a74f94d74640999ea19cf61517'/>
<id>urn:sha1:07601b5b360264a74f94d74640999ea19cf61517</id>
<content type='text'>
Code clean-up.

* ma/worktree-cleanups:
  worktree: use skip_prefix to parse target
  worktree: rename copy-pasted variable
  worktree: update renamed variable in comment
  worktree: inline `worktree_ref()` into its only caller
  wt-status: introduce wt_status_state_free_buffers()
  wt-status: print to s-&gt;fp, not stdout
  wt-status: replace sha1 mentions with oid
</content>
</entry>
<entry>
<title>wt-status: introduce wt_status_state_free_buffers()</title>
<updated>2020-09-27T21:21:47Z</updated>
<author>
<name>Martin Ågren</name>
<email>martin.agren@gmail.com</email>
</author>
<published>2020-09-27T13:15:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=962dd7ebc3e76afc2c896d377c319f8140966303'/>
<id>urn:sha1:962dd7ebc3e76afc2c896d377c319f8140966303</id>
<content type='text'>
When we have a `struct wt_status_state`, we manually free its `branch`,
`onto` and `detached_from`, or sometimes just one or two of them.
Provide a function `wt_status_state_free_buffers()` which does the
freeing.

The callers are still aware of these fields, e.g., they check whether
`branch` was populated or not. But this way, they don't need to know
about *all* of them, and if `struct wt_status_state` gets more fields,
they will not need to learn to free them.

Users of `struct wt_status` (which contains a `wt_status_state`) already
have `wt_status_collect_free_buffers()` (corresponding to
`wt_status_collect()`) which we can also teach to use this new helper.

Finally, note that we're currently leaving dangling pointers behind.
Some callers work on a stack-allocated struct, where this is obviously
ok. But for the users of `run_status()` in builtin/commit.c, there are
ample opportunities for someone to mistakenly use those dangling
pointers. We seem to be ok for now, but it's a use-after-free waiting to
happen. Let's leave NULL-pointers behind instead.

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>ref-filter: plug memory leak in reach_filter()</title>
<updated>2020-09-26T22:39:49Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2020-09-26T08:37:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5336d5069626a9e06e224cbc1730ee96c5742108'/>
<id>urn:sha1:5336d5069626a9e06e224cbc1730ee96c5742108</id>
<content type='text'>
21bf933928 (ref-filter: allow merged and no-merged filters, 2020-09-15)
added an early return to reach_filter().  Avoid leaking the memory of a
then unused array by postponing its allocation until we know we need it.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ref-filter: make internal reachable-filter API more precise</title>
<updated>2020-09-18T22:41:55Z</updated>
<author>
<name>Aaron Lipman</name>
<email>alipman88@gmail.com</email>
</author>
<published>2020-09-18T21:58:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a1b19aa5d43c46fc570f6946ab5ad001dccc8cdf'/>
<id>urn:sha1:a1b19aa5d43c46fc570f6946ab5ad001dccc8cdf</id>
<content type='text'>
The internal reachable-filter API is a bit loose and imprecise; it
also bleeds unnecessarily into the public header. Tighten the API
by:

* renaming do_merge_filter() to reach_filter()

* separating parameters to explicitly identify what data is used
  by the function instead of passing an entire ref_filter_cbdata
  struct

* renaming and moving internal constants from header to source
  file

Signed-off-by: Aaron Lipman &lt;alipman88@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ref-filter: allow merged and no-merged filters</title>
<updated>2020-09-16T19:38:10Z</updated>
<author>
<name>Aaron Lipman</name>
<email>alipman88@gmail.com</email>
</author>
<published>2020-09-16T02:08:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=21bf933928c02372633b88aa6c4d9d71271d42b3'/>
<id>urn:sha1:21bf933928c02372633b88aa6c4d9d71271d42b3</id>
<content type='text'>
Enable ref-filter to process multiple merged and no-merged filters, and
extend functionality to git branch, git tag and git for-each-ref. This
provides an easy way to check for branches that are "graduation
candidates:"

$ git branch --no-merged master --merged next

If passed more than one merged (or more than one no-merged) filter, refs
must be reachable from any one of the merged commits, and reachable from
none of the no-merged commits.

Signed-off-by: Aaron Lipman &lt;alipman88@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'hv/ref-filter-misc'</title>
<updated>2020-09-09T20:53:07Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-09-09T20:53:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c25fba986bfc737d775430d290b93136d390e067'/>
<id>urn:sha1:c25fba986bfc737d775430d290b93136d390e067</id>
<content type='text'>
The "--format=" option to the "for-each-ref" command and friends
learned a few more tricks, e.g. the ":short" suffix that applies to
"objectname" now also can be used for "parent", "tree", etc.

* hv/ref-filter-misc:
  ref-filter: add `sanitize` option for 'subject' atom
  pretty: refactor `format_sanitized_subject()`
  ref-filter: add `short` modifier to 'parent' atom
  ref-filter: add `short` modifier to 'tree' atom
  ref-filter: rename `objectname` related functions and fields
  ref-filter: modify error messages in `grab_objectname()`
  ref-filter: refactor `grab_objectname()`
  ref-filter: support different email formats
</content>
</entry>
<entry>
<title>Merge branch 'hv/ref-filter-trailers-atom-parsing-fix'</title>
<updated>2020-08-31T22:49:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-08-31T22:49:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e17723842b4fd42215ebf9c7ee5ab0bdfbe5a402'/>
<id>urn:sha1:e17723842b4fd42215ebf9c7ee5ab0bdfbe5a402</id>
<content type='text'>
The parser for "git for-each-ref --format=..." was too loose when
parsing the "%(trailers...)" atom, and forgot that "trailers" and
"trailers:&lt;modifiers&gt;" are the only two allowed forms, which has
been corrected.

* hv/ref-filter-trailers-atom-parsing-fix:
  ref-filter: 'contents:trailers' show error if `:` is missing
  t6300: unify %(trailers) and %(contents:trailers) tests
</content>
</entry>
<entry>
<title>ref-filter: add `sanitize` option for 'subject' atom</title>
<updated>2020-08-28T20:52:51Z</updated>
<author>
<name>Hariom Verma</name>
<email>hariom18599@gmail.com</email>
</author>
<published>2020-08-21T21:41:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=905f0a4e64bef35482a999dd01c64945b260c010'/>
<id>urn:sha1:905f0a4e64bef35482a999dd01c64945b260c010</id>
<content type='text'>
Currently, subject does not take any arguments. This commit introduce
`sanitize` formatting option to 'subject' atom.

`subject:sanitize` - print sanitized subject line, suitable for a filename.

e.g.
%(subject): "the subject line"
%(subject:sanitize): "the-subject-line"

Mentored-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Mentored-by: Heba Waly &lt;heba.waly@gmail.com&gt;
Signed-off-by: Hariom Verma &lt;hariom18599@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ref-filter: add `short` modifier to 'parent' atom</title>
<updated>2020-08-28T20:52:50Z</updated>
<author>
<name>Hariom Verma</name>
<email>hariom18599@gmail.com</email>
</author>
<published>2020-08-21T21:41:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=26bc0aaf99147cdf2d29cb6d831dfa72ec94b61b'/>
<id>urn:sha1:26bc0aaf99147cdf2d29cb6d831dfa72ec94b61b</id>
<content type='text'>
Sometimes while using 'parent' atom, user might want to see abbrev hash
instead of full 40 character hash.

Just like 'objectname', it might be convenient for users to have the
`:short` and `:short=&lt;length&gt;` option for printing 'parent' hash.

Let's introduce `short` option to 'parent' atom.

Mentored-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Mentored-by: Heba Waly &lt;heba.waly@gmail.com&gt;
Signed-off-by: Hariom Verma &lt;hariom18599@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ref-filter: add `short` modifier to 'tree' atom</title>
<updated>2020-08-28T20:52:50Z</updated>
<author>
<name>Hariom Verma</name>
<email>hariom18599@gmail.com</email>
</author>
<published>2020-08-21T21:41:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=837adb102f6bfd6e05c75afc630f20c1c720cc74'/>
<id>urn:sha1:837adb102f6bfd6e05c75afc630f20c1c720cc74</id>
<content type='text'>
Sometimes while using 'tree' atom, user might want to see abbrev hash
instead of full 40 character hash.

Just like 'objectname', it might be convenient for users to have the
`:short` and `:short=&lt;length&gt;` option for printing 'tree' hash.

Let's introduce `short` option to 'tree' atom.

Mentored-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Mentored-by: Heba Waly &lt;heba.waly@gmail.com&gt;
Signed-off-by: Hariom Verma &lt;hariom18599@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
