<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/worktree.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>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>Merge branch 'es/worktree-add-cleanup'</title>
<updated>2015-08-12T21:09:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-08-12T21:09:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=53860f03927fea9c46d64b556a06fffe4b46e41f'/>
<id>urn:sha1:53860f03927fea9c46d64b556a06fffe4b46e41f</id>
<content type='text'>
The "new-worktree-mode" hack in "checkout" that was added in
nd/multiple-work-trees topic has been removed by updating the
implementation of new "worktree add".

* es/worktree-add-cleanup: (25 commits)
  Documentation/git-worktree: fix duplicated 'from'
  Documentation/config: mention "now" and "never" for 'expire' settings
  Documentation/git-worktree: fix broken 'linkgit' invocation
  checkout: drop intimate knowledge of newly created worktree
  worktree: populate via "git reset --hard" rather than "git checkout"
  worktree: avoid resolving HEAD unnecessarily
  worktree: make setup of new HEAD distinct from worktree population
  worktree: detect branch-name/detached and error conditions locally
  worktree: add_worktree: construct worktree-population command locally
  worktree: elucidate environment variables intended for child processes
  worktree: make branch creation distinct from worktree population
  worktree: add: suppress auto-vivication with --detach and no &lt;branch&gt;
  worktree: make --detach mutually exclusive with -b/-B
  worktree: introduce options container
  worktree: simplify new branch (-b/-B) option checking
  worktree: improve worktree setup message
  branch: publish die_if_checked_out()
  checkout: teach check_linked_checkout() about symbolic link HEAD
  checkout: check_linked_checkout: simplify symref parsing
  checkout: check_linked_checkout: improve "already checked out" aesthetic
  ...
</content>
</entry>
<entry>
<title>worktree: populate via "git reset --hard" rather than "git checkout"</title>
<updated>2015-07-20T18:29:52Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2015-07-17T23:00:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1c56190aec502d946eb3db7365d6e54e2ffc7bd2'/>
<id>urn:sha1:1c56190aec502d946eb3db7365d6e54e2ffc7bd2</id>
<content type='text'>
Now that git-worktree handles all functionality (--force, --detach,
-b/-B) previously delegated to git-checkout, actual population of the
new worktree can be accomplished more directly and lightweight with
"git reset --hard" in place of "git checkout".

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree: avoid resolving HEAD unnecessarily</title>
<updated>2015-07-20T18:29:52Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2015-07-17T23:00:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ed197a6ab983783550bd0b0c71cb97d734f4cfaa'/>
<id>urn:sha1:ed197a6ab983783550bd0b0c71cb97d734f4cfaa</id>
<content type='text'>
Now that git-worktree sets HEAD explicitly to its final value via either
git-symbolic-ref or git-update-ref, rather than relying upon
git-checkout to do so, the "hack" for pacifying is_git_directory() with
a temporary HEAD, though still necessary, can be simplified.

Since the real HEAD is now populated with its proper final value, the
value of the temporary HEAD truly no longer matters, and any value which
looks like an object ID is good enough to satisfy is_git_directory().
Therefore, just set the temporary HEAD to a literal value rather than
going through the effort of resolving the current branch's HEAD.

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree: make setup of new HEAD distinct from worktree population</title>
<updated>2015-07-20T18:29:52Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2015-07-17T23:00:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7f44e3d1de08bf99c8dbd69d6437b712df369692'/>
<id>urn:sha1:7f44e3d1de08bf99c8dbd69d6437b712df369692</id>
<content type='text'>
git-worktree currently conflates setting of HEAD in the new worktree and
initial worktree population into a single git-checkout invocation which
requires git-checkout to have special knowledge that it is operating on
a newly created worktree. The eventual goal is to rid git-checkout of
that overly-intimate knowledge.

Once these operations are separate, git-worktree will no longer be able
to delegate to git-branch the setting of the new worktree's HEAD to the
desired branch (or commit, if detached). Therefore, make git-worktree
itself responsible for setting up HEAD as either a symbolic reference,
if associated with a branch, or detached, if not.

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree: detect branch-name/detached and error conditions locally</title>
<updated>2015-07-20T18:29:52Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2015-07-17T23:00:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f7c9dac1b037e453e934c272d77cc648d56d5477'/>
<id>urn:sha1:f7c9dac1b037e453e934c272d77cc648d56d5477</id>
<content type='text'>
git-worktree currently conflates setting of HEAD in the new worktree
with initial worktree population via a single git-checkout invocation,
which requires git-checkout to have special knowledge that it is
operating in a newly created worktree. The eventual goal is to separate
these operations and rid git-checkout of that overly-intimate knowledge.

Once these operations are separate, git-worktree will no longer be able
to rely upon git-branch to determine the state of the worktree (branch
name or detached), or to check for error conditions, such as the
requested branch already checked out elsewhere, or an invalid reference.
Therefore, imbue git-worktree with the intelligence to determine a
branch name or detached state locally, and to perform error checking on
its own.

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree: add_worktree: construct worktree-population command locally</title>
<updated>2015-07-20T18:29:52Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2015-07-17T23:00:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=80a0548f6c12f43e9bd62e13eacb033f05e2b001'/>
<id>urn:sha1:80a0548f6c12f43e9bd62e13eacb033f05e2b001</id>
<content type='text'>
The caller of add_worktree() provides it with a command to invoke to
populate the new worktree. This was a useful abstraction during the
conversion of "git checkout --to" functionality to "git worktree add"
since git-checkout and git-worktree constructed the population command
differently. However, now that "git checkout --to" has been retired, and
add_worktree() has access to the options given to "worktree add", this
extra indirection is no longer useful and makes the code a bit
convoluted.

Moreover, the eventual goal is for git-worktree to make setting of HEAD
and worktree population distinct operations, whereas they are currently
conflated into a single git-checkout invocation. As such, add_worktree()
will eventually invoke other commands in addition to the worktree
population command, so it will be doing command construction itself
anyhow.

Therefore, relocate construction of the worktree population command from
add() to add_worktree().

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>worktree: elucidate environment variables intended for child processes</title>
<updated>2015-07-20T18:29:51Z</updated>
<author>
<name>Eric Sunshine</name>
<email>sunshine@sunshineco.com</email>
</author>
<published>2015-07-17T23:00:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ae2a38271f778522ceb9182b94e0024a816e3338'/>
<id>urn:sha1:ae2a38271f778522ceb9182b94e0024a816e3338</id>
<content type='text'>
Take advantage of 'struct child_process.env' to make it obvious that
environment variables set by add_worktree() are intended specifically
for sub-commands it invokes to operate in the new worktree.

We assign a local 'struct argv_array' to child_process.env, rather than
utilizing the child_process.env_array 'struct argv_array', because
future patches will make add_worktree() invoke additional sub-commands,
and it's simpler to populate the environment array just once, whereas
child_process.env_array gets cleared after each invocation, thus would
require re-population for each sub-command.

Signed-off-by: Eric Sunshine &lt;sunshine@sunshineco.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
