<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/path.h, branch v2.44.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.44.4</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.44.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-01-19T19:10:41Z</updated>
<entry>
<title>refs: convert MERGE_AUTOSTASH to become a normal pseudo-ref</title>
<updated>2024-01-19T19:10:41Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-01-19T10:40:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3f921c75913a4ba7b73cb0d8ec05a2cf24d1f4d4'/>
<id>urn:sha1:3f921c75913a4ba7b73cb0d8ec05a2cf24d1f4d4</id>
<content type='text'>
Similar to the preceding conversion of the AUTO_MERGE pseudo-ref, let's
convert the MERGE_AUTOSTASH ref to become a normal pseudo-ref as well.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: convert AUTO_MERGE to become a normal pseudo-ref</title>
<updated>2024-01-19T19:10:41Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-01-19T10:40:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fd7c6ffa9e118cdf18a3752ec456070ed0a22e3b'/>
<id>urn:sha1:fd7c6ffa9e118cdf18a3752ec456070ed0a22e3b</id>
<content type='text'>
In 70c70de616 (refs: complete list of special refs, 2023-12-14) we have
inrtoduced a new `is_special_ref()` function that classifies some refs
as being special. The rule is that special refs are exclusively read and
written via the filesystem directly, whereas normal refs exclucsively go
via the refs API.

The intent of that commit was to record the status quo so that we know
to route reads of such special refs consistently. Eventually, the list
should be reduced to its bare minimum of refs which really are special,
namely FETCH_HEAD and MERGE_HEAD.

Follow up on this promise and convert the AUTO_MERGE ref to become a
normal pseudo-ref by using the refs API to both read and write it
instead of accessing the filesystem directly.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>path: move related function to path</title>
<updated>2023-06-12T20:49:36Z</updated>
<author>
<name>Calvin Wan</name>
<email>calvinwan@google.com</email>
</author>
<published>2023-06-06T19:48:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=aba070683295a20bdf4f49146384984961c794b2'/>
<id>urn:sha1:aba070683295a20bdf4f49146384984961c794b2</id>
<content type='text'>
Move path-related function from strbuf.[ch] to path.[ch] so that strbuf
is focused on string manipulation routines with minimal dependencies.

repository.h is no longer a necessary dependency after moving this
function out.

Signed-off-by: Calvin Wan &lt;calvinwan@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>path.h: move function declarations for path.c functions from cache.h</title>
<updated>2023-03-21T17:56:52Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-03-21T06:26:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=905f96939b7887e532c84747ef51466a959b6eb9'/>
<id>urn:sha1:905f96939b7887e532c84747ef51466a959b6eb9</id>
<content type='text'>
Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>repository.c: free the "path cache" in repo_clear()</title>
<updated>2022-03-04T21:24:19Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2022-03-04T18:32:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=759f34073807119ffb935a84aa86e6a8fa7a9bc4'/>
<id>urn:sha1:759f34073807119ffb935a84aa86e6a8fa7a9bc4</id>
<content type='text'>
The "struct path_cache" added in 102de880d24 (path.c: migrate global
git_path_* to take a repository argument, 2018-05-17) is only used
directly by code in repository.[ch] (but populated in path.[ch]).

Let's move this code to repository.[ch], and stop leaking this memory
when we run repo_clear(). To avoid the cast change it from a "const
char *" to a "char *".

This also removes the "PATH_CACHE_INIT" macro, which has never been
used for anything. For the "struct repository" we already make a hard
assumption that it (and "the_repository") can be identically
initialized by making it a "static" variable, so making use of a
"PATH_CACHE_INIT" somewhere would have been confusing.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>*.[ch] *_INIT macros: use { 0 } for a "zero out" idiom</title>
<updated>2021-09-27T21:47:59Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2021-09-27T12:54:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9865b6e6a4ca1e895fd473c827cf1822f3bd8249'/>
<id>urn:sha1:9865b6e6a4ca1e895fd473c827cf1822f3bd8249</id>
<content type='text'>
In C it isn't required to specify that all members of a struct are
zero'd out to 0, NULL or '\0', just providing a "{ 0 }" will
accomplish that.

Let's also change code that provided N zero'd fields to just
provide one, and change e.g. "{ NULL }" to "{ 0 }" for
consistency. I.e. even if the first member is a pointer let's use "0"
instead of "NULL". The point of using "0" consistently is to pick one,
and to not have the reader wonder why we're not using the same pattern
everywhere.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>merge-ort: write $GIT_DIR/AUTO_MERGE whenever we hit a conflict</title>
<updated>2021-03-20T19:35:40Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2021-03-20T00:03:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5291828df8386ebeb01039d1403d9f845d2f6e20'/>
<id>urn:sha1:5291828df8386ebeb01039d1403d9f845d2f6e20</id>
<content type='text'>
There are a variety of questions users might ask while resolving
conflicts:
  * What changes have been made since the previous (first) parent?
  * What changes are staged?
  * What is still unstaged? (or what is still conflicted?)
  * What changes did I make to resolve conflicts so far?
The first three of these have simple answers:
  * git diff HEAD
  * git diff --cached
  * git diff
There was no way to answer the final question previously.  Adding one
is trivial in merge-ort, since it works by creating a tree representing
what should be written to the working copy complete with conflict
markers.  Simply write that tree to .git/AUTO_MERGE, allowing users to
answer the fourth question with
  * git diff AUTO_MERGE

I avoided using a name like "MERGE_AUTO", because that would be
merge-specific (much like MERGE_HEAD, REBASE_HEAD, REVERT_HEAD,
CHERRY_PICK_HEAD) and I wanted a name that didn't change depending on
which type of operation the merge was part of.

Ensure that paths which clean out other temporary operation-specific
files (e.g. CHERRY_PICK_HEAD, MERGE_MSG, rebase-merge/ state directory)
also clean out this AUTO_MERGE file.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Reviewed-by: Derrick Stolee &lt;dstolee@microsoft.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>sequencer: treat REVERT_HEAD as a pseudo ref</title>
<updated>2020-08-21T18:20:11Z</updated>
<author>
<name>Han-Wen Nienhuys</name>
<email>hanwen@google.com</email>
</author>
<published>2020-08-21T16:59:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b8825ef233840136bd01a9619b36af515f498eb2'/>
<id>urn:sha1:b8825ef233840136bd01a9619b36af515f498eb2</id>
<content type='text'>
Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>sequencer: treat CHERRY_PICK_HEAD as a pseudo ref</title>
<updated>2020-08-21T18:20:10Z</updated>
<author>
<name>Han-Wen Nienhuys</name>
<email>hanwen@google.com</email>
</author>
<published>2020-08-21T16:59:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c8e4159efd226218d827b5da71fc8f95f8172412'/>
<id>urn:sha1:c8e4159efd226218d827b5da71fc8f95f8172412</id>
<content type='text'>
Check for existence and delete CHERRY_PICK_HEAD through ref functions.
This will help cherry-pick work with alternate ref storage backends.

Signed-off-by: Han-Wen Nienhuys &lt;hanwen@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>merge: teach --autostash option</title>
<updated>2020-04-10T16:28:02Z</updated>
<author>
<name>Denton Liu</name>
<email>liu.denton@gmail.com</email>
</author>
<published>2020-04-07T14:28:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a03b55530ab844974b7058042a015fcfcd9e7a53'/>
<id>urn:sha1:a03b55530ab844974b7058042a015fcfcd9e7a53</id>
<content type='text'>
In rebase, one can pass the `--autostash` option to cause the worktree
to be automatically stashed before continuing with the rebase. This
option is missing in merge, however.

Implement the `--autostash` option and corresponding `merge.autoStash`
option in merge which stashes before merging and then pops after.

This option is useful when a developer has some local changes on a topic
branch but they realize that their work depends on another branch.
Previously, they had to run something like

	git fetch ...
	git stash push
	git merge FETCH_HEAD
	git stash pop

but now, that is reduced to

	git fetch ...
	git merge --autostash FETCH_HEAD

When an autostash is generated, it is automatically reapplied to the
worktree only in three explicit situations:

	1. An incomplete merge is commit using `git commit`.
	2. A merge completes successfully.
	3. A merge is aborted using `git merge --abort`.

In all other situations where the merge state is removed using
remove_merge_branch_state() such as aborting a merge via
`git reset --hard`, the autostash is saved into the stash reflog
instead keeping the worktree clean.

Helped-by: Phillip Wood &lt;phillip.wood@dunelm.org.uk&gt;
Suggested-by: Alban Gruin &lt;alban.gruin@gmail.com&gt;
Signed-off-by: Denton Liu &lt;liu.denton@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
