<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refs.c, branch v2.30.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.30.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.30.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-12-13T23:53:51Z</updated>
<entry>
<title>init: provide useful advice about init.defaultBranch</title>
<updated>2020-12-13T23:53:51Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2020-12-11T11:36:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=675704c74dd4476f455bfa91e72eb9e163317c10'/>
<id>urn:sha1:675704c74dd4476f455bfa91e72eb9e163317c10</id>
<content type='text'>
To give ample warning for users wishing to override Git's the fall-back
for an unconfigured `init.defaultBranch` (in case we decide to change it
in a future Git version), let's introduce some advice that is shown upon
`git init` when that value is not set.

Note: two test cases in Git's test suite want to verify that the
`stderr` output of `git init` is empty. It is now necessary to suppress
the advice, we now do that via the `init.defaultBranch` setting. While
not strictly necessary, we also set this to `false` in
`test_create_repo()`.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>get_default_branch_name(): prepare for showing some advice</title>
<updated>2020-12-13T23:53:50Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2020-12-11T11:36:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cc0f13c57dedaf62c9f852b6bf363aee7e3392f1'/>
<id>urn:sha1:cc0f13c57dedaf62c9f852b6bf363aee7e3392f1</id>
<content type='text'>
We are about to introduce a message giving users running `git init` some
advice about `init.defaultBranch`. This will necessarily be done in
`repo_default_branch_name()`.

Not all code paths want to show that advice, though. In particular, the
`git clone` codepath _specifically_ asks for `init_db()` to be quiet,
via the `INIT_DB_QUIET` flag.

In preparation for showing users above-mentioned advice, let's change
the function signature of `get_default_branch_name()` to accept the
parameter `quiet`.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tests: start moving to a different default main branch name</title>
<updated>2020-10-23T15:57:40Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2020-10-23T14:00:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=704fed9ea22230929639c9e5fca122045f84311d'/>
<id>urn:sha1:704fed9ea22230929639c9e5fca122045f84311d</id>
<content type='text'>
To allow for an incremental conversion to a new default main branch
name, let's introduce `GIT_TEST_DEFAULT_MAIN_BRANCH_NAME`. This
environment variable can be set at the top of each converted test
script, overriding the default main branch name to use when initializing
new repositories (or cloning empty repositories).

Note: the `GIT_TEST_DEFAULT_MAIN_BRANCH_NAME` is _not_ intended to be
used manually; many tests require a specific main branch name and cannot
simply work with another one. This `GIT_TEST_*` variable is meant purely
for the transitional period while the entire test suite is converted to
use `main` as the initial branch name by default.

We also introduce the `PREPARE_FOR_MAIN_BRANCH` prereq that determines
whether the default main branch name is `main`, and adjust a couple of
test functions to use it. This prereq will be used to temporarily
disable a couple test cases to allow for adjusting the test script
incrementally. Once an entire test is adjusted, we will adjust the test
so that it is run with `GIT_TEST_DEFAULT_MAIN_BRANCH_NAME=main`.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'hn/refs-trace-backend'</title>
<updated>2020-09-22T19:36:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-09-22T19:36:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c9a04f036f6d52a2bca1c41bda6ecc1633c8e4cb'/>
<id>urn:sha1:c9a04f036f6d52a2bca1c41bda6ecc1633c8e4cb</id>
<content type='text'>
Developer support.

* hn/refs-trace-backend:
  refs: add GIT_TRACE_REFS debugging mechanism
</content>
</entry>
<entry>
<title>Merge branch 'jt/interpret-branch-name-fallback'</title>
<updated>2020-09-09T20:53:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-09-09T20:53:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0df670bc0b8b5499859829ba0889ce96a75304a6'/>
<id>urn:sha1:0df670bc0b8b5499859829ba0889ce96a75304a6</id>
<content type='text'>
"git status" has trouble showing where it came from by interpreting
reflog entries that recordcertain events, e.g. "checkout @{u}", and
gives a hard/fatal error.  Even though it inherently is impossible
to give a correct answer because the reflog entries lose some
information (e.g. "@{u}" does not record what branch the user was
on hence which branch 'the upstream' needs to be computed, and even
if the record were available, the relationship between branches may
have changed), at least hide the error to allow "status" show its
output.

* jt/interpret-branch-name-fallback:
  wt-status: tolerate dangling marks
  refs: move dwim_ref() to header file
  sha1-name: replace unsigned int with option struct
</content>
</entry>
<entry>
<title>refs: add GIT_TRACE_REFS debugging mechanism</title>
<updated>2020-09-09T19:58:37Z</updated>
<author>
<name>Han-Wen Nienhuys</name>
<email>hanwen@google.com</email>
</author>
<published>2020-09-09T10:15:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4441f4270758042cc38ce8c04e4350ada743b28a'/>
<id>urn:sha1:4441f4270758042cc38ce8c04e4350ada743b28a</id>
<content type='text'>
When set in the environment, GIT_TRACE_REFS makes git print operations and
results as they flow through the ref storage backend. This helps debug
discrepancies between different ref backends.

Example:

    $ GIT_TRACE_REFS="1" ./git branch
    15:42:09.769631 refs/debug.c:26         ref_store for .git
    15:42:09.769681 refs/debug.c:249        read_raw_ref: HEAD: 0000000000000000000000000000000000000000 (=&gt; refs/heads/ref-debug) type 1: 0
    15:42:09.769695 refs/debug.c:249        read_raw_ref: refs/heads/ref-debug: 3a238e539bcdfe3f9eb5010fd218640c1b499f7a (=&gt; refs/heads/ref-debug) type 0: 0
    15:42:09.770282 refs/debug.c:233        ref_iterator_begin: refs/heads/ (0x1)
    15:42:09.770290 refs/debug.c:189        iterator_advance: refs/heads/b4 (0)
    15:42:09.770295 refs/debug.c:189        iterator_advance: refs/heads/branch3 (0)

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>wt-status: tolerate dangling marks</title>
<updated>2020-09-02T21:39:25Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2020-09-01T22:28:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f24c30e0b6b13078d8fc7cd71b9989d28fd76610'/>
<id>urn:sha1:f24c30e0b6b13078d8fc7cd71b9989d28fd76610</id>
<content type='text'>
When a user checks out the upstream branch of HEAD, the upstream branch
not being a local branch, and then runs "git status", like this:

  git clone $URL client
  cd client
  git checkout @{u}
  git status

no status is printed, but instead an error message:

  fatal: HEAD does not point to a branch

(This error message when running "git branch" persists even after
checking out other things - it only stops after checking out a branch.)

This is because "git status" reads the reflog when determining the "HEAD
detached" message, and thus attempts to DWIM "@{u}", but that doesn't
work because HEAD no longer points to a branch.

Therefore, when calculating the status of a worktree, tolerate dangling
marks. This is done by adding an additional parameter to
dwim_ref() and repo_dwim_ref().

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: move dwim_ref() to header file</title>
<updated>2020-09-02T21:39:17Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2020-09-01T22:28:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ec06b05568bb9dbb7333a5974b4512db18395674'/>
<id>urn:sha1:ec06b05568bb9dbb7333a5974b4512db18395674</id>
<content type='text'>
This makes it clear that dwim_ref() is just repo_dwim_ref() without the
first parameter.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>sha1-name: replace unsigned int with option struct</title>
<updated>2020-09-02T21:39:17Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2020-09-01T22:28:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a4f66a7876f6979f0a3ac254173cbdaf0a2a55c3'/>
<id>urn:sha1:a4f66a7876f6979f0a3ac254173cbdaf0a2a55c3</id>
<content type='text'>
In preparation for a future patch adding a boolean parameter to
repo_interpret_branch_name(), which might be easily confused with an
existing unsigned int parameter, refactor repo_interpret_branch_name()
to take an option struct instead of the unsigned int parameter.

The static function interpret_branch_mark() is also updated to take the
option struct in preparation for that future patch, since it will also
make use of the to-be-introduced boolean parameter.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ps/ref-transaction-hook'</title>
<updated>2020-08-31T22:49:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-08-31T22:49:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6ddd76fd6c356c037b5d5272732900f1f952721e'/>
<id>urn:sha1:6ddd76fd6c356c037b5d5272732900f1f952721e</id>
<content type='text'>
Code simplification by removing ineffective optimization.

* ps/ref-transaction-hook:
  refs: remove lookup cache for reference-transaction hook
</content>
</entry>
</feed>
