<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/bisect.c, branch v2.6.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.6.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.6.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-08-25T21:57:08Z</updated>
<entry>
<title>Merge branch 'dt/refs-pseudo'</title>
<updated>2015-08-25T21:57:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-08-25T21:57:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=080cc646637f20494138c62fe6b8b0fee8d521fa'/>
<id>urn:sha1:080cc646637f20494138c62fe6b8b0fee8d521fa</id>
<content type='text'>
To prepare for allowing a different "ref" backend to be plugged in
to the system, update_ref()/delete_ref() have been taught about
ref-like things like MERGE_HEAD that are per-worktree (they will
always be written to the filesystem inside $GIT_DIR).

* dt/refs-pseudo:
  pseudoref: check return values from read_ref()
  sequencer: replace write_cherry_pick_head with update_ref
  bisect: use update_ref
  pseudorefs: create and use pseudoref update and delete functions
  refs: add ref_type function
  refs: introduce pseudoref and per-worktree ref concepts
</content>
</entry>
<entry>
<title>Merge branch 'jk/git-path'</title>
<updated>2015-08-19T21:48:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-08-19T21:48:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8c9155e031869293b99531a25b585e49f74beaba'/>
<id>urn:sha1:8c9155e031869293b99531a25b585e49f74beaba</id>
<content type='text'>
git_path() and mkpath() are handy helper functions but it is easy
to misuse, as the callers need to be careful to keep the number of
active results below 4.  Their uses have been reduced.

* jk/git-path:
  memoize common git-path "constant" files
  get_repo_path: refactor path-allocation
  find_hook: keep our own static buffer
  refs.c: remove_empty_directories can take a strbuf
  refs.c: avoid git_path assignment in lock_ref_sha1_basic
  refs.c: avoid repeated git_path calls in rename_tmp_log
  refs.c: simplify strbufs in reflog setup and writing
  path.c: drop git_path_submodule
  refs.c: remove extra git_path calls from read_loose_refs
  remote.c: drop extraneous local variable from migrate_file
  prefer mkpathdup to mkpath in assignments
  prefer git_pathdup to git_path in some possibly-dangerous cases
  add_to_alternates_file: don't add duplicate entries
  t5700: modernize style
  cache.h: complete set of git_path_submodule helpers
  cache.h: clarify documentation for git_path, et al
</content>
</entry>
<entry>
<title>memoize common git-path "constant" files</title>
<updated>2015-08-10T22:37:14Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-08-10T09:38:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f932729cc7707390f4d6739be1573e93ceb9df22'/>
<id>urn:sha1:f932729cc7707390f4d6739be1573e93ceb9df22</id>
<content type='text'>
One of the most common uses of git_path() is to pass a
constant, like git_path("MERGE_MSG"). This has two
drawbacks:

  1. The return value is a static buffer, and the lifetime
     is dependent on other calls to git_path, etc.

  2. There's no compile-time checking of the pathname. This
     is OK for a one-off (after all, we have to spell it
     correctly at least once), but many of these constant
     strings appear throughout the code.

This patch introduces a series of functions to "memoize"
these strings, which are essentially globals for the
lifetime of the program. We compute the value once, take
ownership of the buffer, and return the cached value for
subsequent calls.  cache.h provides a helper macro for
defining these functions as one-liners, and defines a few
common ones for global use.

Using a macro is a little bit gross, but it does nicely
document the purpose of the functions. If we need to touch
them all later (e.g., because we learned how to change the
git_dir variable at runtime, and need to invalidate all of
the stored values), it will be much easier to have the
complete list.

Note that the shared-global functions have separate, manual
declarations. We could do something clever with the macros
(e.g., expand it to a declaration in some places, and a
declaration _and_ a definition in path.c). But there aren't
that many, and it's probably better to stay away from
too-magical macros.

Likewise, if we abandon the C preprocessor in favor of
generating these with a script, we could get much fancier.
E.g., normalizing "FOO/BAR-BAZ" into "git_path_foo_bar_baz".
But the small amount of saved typing is probably not worth
the resulting confusion to readers who want to grep for the
function's definition.

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>bisect: simplify the addition of new bisect terms</title>
<updated>2015-08-03T18:42:41Z</updated>
<author>
<name>Antoine Delaite</name>
<email>antoine.delaite@ensimag.grenoble-inp.fr</email>
</author>
<published>2015-06-29T15:40:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cb46d630baf780412f8ca0592531880b592f0922'/>
<id>urn:sha1:cb46d630baf780412f8ca0592531880b592f0922</id>
<content type='text'>
We create a file BISECT_TERMS in the repository .git to be read during a
bisection. There's no user-interface yet, but "git bisect" works if terms
other than old/new or bad/good are set in .git/BISECT_TERMS. The
fonctions to be changed if we add new terms are quite few.

In git-bisect.sh:
	check_and_set_terms
	bisect_voc

Co-authored-by: Louis Stuber &lt;stuberl@ensimag.grenoble-inp.fr&gt;
Tweaked-by: Matthieu Moy &lt;Matthieu.Moy@imag.fr&gt;
Signed-off-by: Antoine Delaite &lt;antoine.delaite@ensimag.grenoble-inp.fr&gt;
Signed-off-by: Louis Stuber &lt;stuberl@ensimag.grenoble-inp.fr&gt;
Signed-off-by: Valentin Duperray &lt;Valentin.Duperray@ensimag.imag.fr&gt;
Signed-off-by: Franck Jonas &lt;Franck.Jonas@ensimag.imag.fr&gt;
Signed-off-by: Lucien Kong &lt;Lucien.Kong@ensimag.imag.fr&gt;
Signed-off-by: Thomas Nguy &lt;Thomas.Nguy@ensimag.imag.fr&gt;
Signed-off-by: Huynh Khoi Nguyen Nguyen &lt;Huynh-Khoi-Nguyen.Nguyen@ensimag.imag.fr&gt;
Signed-off-by: Matthieu Moy &lt;Matthieu.Moy@imag.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bisect: use update_ref</title>
<updated>2015-07-31T17:40:08Z</updated>
<author>
<name>David Turner</name>
<email>dturner@twopensource.com</email>
</author>
<published>2015-07-31T06:06:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f3a977187edd82d6b20fd018e55e471f7cf13d6a'/>
<id>urn:sha1:f3a977187edd82d6b20fd018e55e471f7cf13d6a</id>
<content type='text'>
Instead of manually writing a pseudoref (in one case) and shelling out
to git update-ref (in another), use the update_ref function.  This
is much simpler.

Signed-off-by: David Turner &lt;dturner@twopensource.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bisect: replace hardcoded "bad|good" by variables</title>
<updated>2015-06-29T20:19:12Z</updated>
<author>
<name>Antoine Delaite</name>
<email>antoine.delaite@ensimag.grenoble-inp.fr</email>
</author>
<published>2015-06-29T15:40:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=43f9d9f3a6c6004853fcc7b283dafc3590478498'/>
<id>urn:sha1:43f9d9f3a6c6004853fcc7b283dafc3590478498</id>
<content type='text'>
To add new tags like old/new and have keywords less confusing, the
first step is to avoid hardcoding the keywords.

The default mode is still bad/good.

Signed-off-by: Antoine Delaite &lt;antoine.delaite@ensimag.grenoble-inp.fr&gt;
Signed-off-by: Louis Stuber &lt;stuberl@ensimag.grenoble-inp.fr&gt;
Signed-off-by: Valentin Duperray &lt;Valentin.Duperray@ensimag.imag.fr&gt;
Signed-off-by: Franck Jonas &lt;Franck.Jonas@ensimag.imag.fr&gt;
Signed-off-by: Lucien Kong &lt;Lucien.Kong@ensimag.imag.fr&gt;
Signed-off-by: Thomas Nguy &lt;Thomas.Nguy@ensimag.imag.fr&gt;
Signed-off-by: Huynh Khoi Nguyen Nguyen &lt;Huynh-Khoi-Nguyen.Nguyen@ensimag.imag.fr&gt;
Signed-off-by: Matthieu Moy &lt;Matthieu.Moy@imag.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bisect: correction of typo</title>
<updated>2015-06-23T18:41:56Z</updated>
<author>
<name>Antoine Delaite</name>
<email>antoine.delaite@ensimag.grenoble-inp.fr</email>
</author>
<published>2015-06-23T12:54:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f6216c2c5c113bc6b1ed008c5ed01062042382e1'/>
<id>urn:sha1:f6216c2c5c113bc6b1ed008c5ed01062042382e1</id>
<content type='text'>
Signed-off-by: Antoine Delaite &lt;antoine.delaite@ensimag.grenoble-inp.fr&gt;
Signed-off-by: Matthieu Moy &lt;Matthieu.Moy@imag.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>register_ref(): rewrite to take an object_id argument</title>
<updated>2015-05-25T19:19:28Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2015-05-25T18:38:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eed2514802569f292077214d1a04bccf91b250bd'/>
<id>urn:sha1:eed2514802569f292077214d1a04bccf91b250bd</id>
<content type='text'>
Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>each_ref_fn: change to take an object_id parameter</title>
<updated>2015-05-25T19:19:27Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2015-05-25T18:38:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2b2a5be394bc67bed86bc009195c664dca740bd6'/>
<id>urn:sha1:2b2a5be394bc67bed86bc009195c664dca740bd6</id>
<content type='text'>
Change typedef each_ref_fn to take a "const struct object_id *oid"
parameter instead of "const unsigned char *sha1".

To aid this transition, implement an adapter that can be used to wrap
old-style functions matching the old typedef, which is now called
"each_ref_sha1_fn"), and make such functions callable via the new
interface. This requires the old function and its cb_data to be
wrapped in a "struct each_ref_fn_sha1_adapter", and that object to be
used as the cb_data for an adapter function, each_ref_fn_adapter().

This is an enormous diff, but most of it consists of simple,
mechanical changes to the sites that call any of the "for_each_ref"
family of functions. Subsequent to this change, the call sites can be
rewritten one by one to use the new interface.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>bisect.c: convert leaf functions to use struct object_id</title>
<updated>2015-03-14T05:43:12Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2015-03-13T23:39:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3c5ff9956c017e1737fdc350dbec160277be4fc1'/>
<id>urn:sha1:3c5ff9956c017e1737fdc350dbec160277be4fc1</id>
<content type='text'>
Convert some constants to GIT_SHA1_HEXSZ.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
