<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/submodule.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-31T22:39:03Z</updated>
<entry>
<title>Merge branch 'jc/am-state-fix'</title>
<updated>2015-08-31T22:39:03Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-08-31T22:39:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d75bb73bcf2ecce38c147980aac0cbc27a6b838a'/>
<id>urn:sha1:d75bb73bcf2ecce38c147980aac0cbc27a6b838a</id>
<content type='text'>
Recent reimplementation of "git am" changed the format of state
files kept in $GIT_DIR/rebase-apply/ without meaning to do so,
primarily because write_file() API was cumbersome to use and it was
easy to mistakenly make text files with incomplete lines.  Update
write_file() interface to make it harder to misuse.

* jc/am-state-fix:
  write_file(): drop caller-supplied LF from calls to create a one-liner file
  write_file_v(): do not leave incomplete line at the end
  write_file(): drop "fatal" parameter
  builtin/am: make sure state files are text
  builtin/am: introduce write_state_*() helper functions
</content>
</entry>
<entry>
<title>Merge branch 'hv/submodule-config'</title>
<updated>2015-08-31T22:38:52Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-08-31T22:38:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5a4f07b32207044eb8380f2893f807cc8ab9d58f'/>
<id>urn:sha1:5a4f07b32207044eb8380f2893f807cc8ab9d58f</id>
<content type='text'>
The gitmodules API accessed from the C code learned to cache stuff
lazily.

* hv/submodule-config:
  submodule: allow erroneous values for the fetchRecurseSubmodules option
  submodule: use new config API for worktree configurations
  submodule: extract functions for config set and lookup
  submodule: implement a config API for lookup of .gitmodules values
</content>
</entry>
<entry>
<title>write_file(): drop caller-supplied LF from calls to create a one-liner file</title>
<updated>2015-08-25T19:49:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-08-24T20:20:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1f76a10b2d72245332ac41bd79249cb82f3946f0'/>
<id>urn:sha1:1f76a10b2d72245332ac41bd79249cb82f3946f0</id>
<content type='text'>
All of the callsites covered by this change call write_file() or
write_file_gently() to create a one-liner file.  Drop the caller
supplied LF and let these callees to append it as necessary.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>write_file(): drop "fatal" parameter</title>
<updated>2015-08-24T20:09:02Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-08-24T20:03:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=12d6ce1dba504dfc5279b8d24da3edb4865c2820'/>
<id>urn:sha1:12d6ce1dba504dfc5279b8d24da3edb4865c2820</id>
<content type='text'>
All callers except three passed 1 for the "fatal" parameter to ask
this function to die upon error, but to a casual reader of the code,
it was not all obvious what that 1 meant.  Instead, split the
function into two based on a common write_file_v() that takes the
flag, introduce write_file_gently() as a new way to attempt creating
a file without dying on error, and make three callers to call it.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule: allow erroneous values for the fetchRecurseSubmodules option</title>
<updated>2015-08-19T18:43:10Z</updated>
<author>
<name>Heiko Voigt</name>
<email>hvoigt@hvoigt.net</email>
</author>
<published>2015-08-18T00:22:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=027771fcb153e0003bcb2d68e1838594a48b0161'/>
<id>urn:sha1:027771fcb153e0003bcb2d68e1838594a48b0161</id>
<content type='text'>
We should not die when reading the submodule config cache since the
user might not be able to get out of that situation when the
configuration is part of the history.

We should handle this condition later when the value is about to be
used.

Signed-off-by: Heiko Voigt &lt;hvoigt@hvoigt.net&gt;
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>submodule: use new config API for worktree configurations</title>
<updated>2015-08-19T18:43:10Z</updated>
<author>
<name>Heiko Voigt</name>
<email>hvoigt@hvoigt.net</email>
</author>
<published>2015-08-18T00:21:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=851e18c3859ad0f9f7e91fdb4d6cce5a8272420b'/>
<id>urn:sha1:851e18c3859ad0f9f7e91fdb4d6cce5a8272420b</id>
<content type='text'>
We remove the extracted functions and directly parse into and read out
of the cache. This allows us to have one unified way of accessing
submodule configuration values specific to single submodules. Regardless
whether we need to access a configuration from history or from the
worktree.

Signed-off-by: Heiko Voigt &lt;hvoigt@hvoigt.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
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>submodule: extract functions for config set and lookup</title>
<updated>2015-08-19T18:43:09Z</updated>
<author>
<name>Heiko Voigt</name>
<email>hvoigt@hvoigt.net</email>
</author>
<published>2015-08-18T00:21:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0d9f282c943a0799999176a2d8291ecbad060389'/>
<id>urn:sha1:0d9f282c943a0799999176a2d8291ecbad060389</id>
<content type='text'>
This is one step towards using the new configuration API. We just
extract these functions to make replacing the actual code easier.

Signed-off-by: Heiko Voigt &lt;hvoigt@hvoigt.net&gt;
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>submodule: implement a config API for lookup of .gitmodules values</title>
<updated>2015-08-19T18:43:09Z</updated>
<author>
<name>Heiko Voigt</name>
<email>hvoigt@hvoigt.net</email>
</author>
<published>2015-08-18T00:21:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=959b5455d07c7724eea9d323ca8ce6bb6ddde40e'/>
<id>urn:sha1:959b5455d07c7724eea9d323ca8ce6bb6ddde40e</id>
<content type='text'>
In a superproject some commands need to interact with submodules. They
need to query values from the .gitmodules file either from the worktree
of from certain revisions. At the moment this is quite hard since a
caller would need to read the .gitmodules file from the history and then
parse the values. We want to provide an API for this so we have one
place to get values from .gitmodules from any revision (including the
worktree).

The API is realized as a cache which allows us to lazily read
.gitmodules configurations by commit into a runtime cache which can then
be used to easily lookup values from it. Currently only the values for
path or name are stored but it can be extended for any value needed.

It is expected that .gitmodules files do not change often between
commits. Thats why we lookup the .gitmodules sha1 from a commit and then
either lookup an already parsed configuration or parse and cache an
unknown one for each sha1. The cache is lazily build on demand for each
requested commit.

This cache can be used for all purposes which need knowledge about
submodule configurations. Example use cases are:

 * Recursive submodule checkout needs to lookup a submodule name from
   its path when a submodule first appears. This needs be done before
   this configuration exists in the worktree.

 * The implementation of submodule support for 'git archive' needs to
   lookup the submodule name to generate the archive when given a
   revision that is not checked out.

 * 'git fetch' when given the --recurse-submodules=on-demand option (or
   configuration) needs to lookup submodule names by path from the
   database rather than reading from the worktree. For new submodule it
   needs to lookup the name from its path to allow cloning new
   submodules into the .git folder so they can be checked out without
   any network interaction when the user does a checkout of that
   revision.

Signed-off-by: Heiko Voigt &lt;hvoigt@hvoigt.net&gt;
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>convert "enum date_mode" into a struct</title>
<updated>2015-06-29T18:39:07Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-06-25T16:55:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a5481a6c9438cbd9c246cfa59ff49c31a0926fb6'/>
<id>urn:sha1:a5481a6c9438cbd9c246cfa59ff49c31a0926fb6</id>
<content type='text'>
In preparation for adding date modes that may carry extra
information beyond the mode itself, this patch converts the
date_mode enum into a struct.

Most of the conversion is fairly straightforward; we pass
the struct as a pointer and dereference the type field where
necessary. Locations that declare a date_mode can use a "{}"
constructor.  However, the tricky case is where we use the
enum labels as constants, like:

  show_date(t, tz, DATE_NORMAL);

Ideally we could say:

  show_date(t, tz, &amp;{ DATE_NORMAL });

but of course C does not allow that. Likewise, we cannot
cast the constant to a struct, because we need to pass an
actual address. Our options are basically:

  1. Manually add a "struct date_mode d = { DATE_NORMAL }"
     definition to each caller, and pass "&amp;d". This makes
     the callers uglier, because they sometimes do not even
     have their own scope (e.g., they are inside a switch
     statement).

  2. Provide a pre-made global "date_normal" struct that can
     be passed by address. We'd also need "date_rfc2822",
     "date_iso8601", and so forth. But at least the ugliness
     is defined in one place.

  3. Provide a wrapper that generates the correct struct on
     the fly. The big downside is that we end up pointing to
     a single global, which makes our wrapper non-reentrant.
     But show_date is already not reentrant, so it does not
     matter.

This patch implements 3, along with a minor macro to keep
the size of the callers sane.

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 'bc/object-id'</title>
<updated>2015-06-05T19:17:37Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-06-05T19:17:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5455ee0573a22bb793a7083d593ae1ace909cd4c'/>
<id>urn:sha1:5455ee0573a22bb793a7083d593ae1ace909cd4c</id>
<content type='text'>
for_each_ref() callback functions were taught to name the objects
not with "unsigned char sha1[20]" but with "struct object_id".

* bc/object-id: (56 commits)
  struct ref_lock: convert old_sha1 member to object_id
  warn_if_dangling_symref(): convert local variable "junk" to object_id
  each_ref_fn_adapter(): remove adapter
  rev_list_insert_ref(): remove unneeded arguments
  rev_list_insert_ref_oid(): new function, taking an object_oid
  mark_complete(): remove unneeded arguments
  mark_complete_oid(): new function, taking an object_oid
  clear_marks(): rewrite to take an object_id argument
  mark_complete(): rewrite to take an object_id argument
  send_ref(): convert local variable "peeled" to object_id
  upload-pack: rewrite functions to take object_id arguments
  find_symref(): convert local variable "unused" to object_id
  find_symref(): rewrite to take an object_id argument
  write_one_ref(): rewrite to take an object_id argument
  write_refs_to_temp_dir(): convert local variable sha1 to object_id
  submodule: rewrite to take an object_id argument
  shallow: rewrite functions to take object_id arguments
  handle_one_ref(): rewrite to take an object_id argument
  add_info_ref(): rewrite to take an object_id argument
  handle_one_reflog(): rewrite to take an object_id argument
  ...
</content>
</entry>
</feed>
