<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/remote.c, branch v2.12.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.12.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.12.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-03-24T19:57:53Z</updated>
<entry>
<title>Merge branch 'jn/remote-helpers-with-git-dir' into maint</title>
<updated>2017-03-24T19:57:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-03-24T19:57:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=411a1794120fa044f92ff53f41a4aa81018ed507'/>
<id>urn:sha1:411a1794120fa044f92ff53f41a4aa81018ed507</id>
<content type='text'>
"git ls-remote" and "git archive --remote" are designed to work
without being in a directory under Git's control.  However, recent
updates revealed that we randomly look into a directory called
.git/ without actually doing necessary set-up when working in a
repository.  Stop doing so.

* jn/remote-helpers-with-git-dir:
  remote helpers: avoid blind fall-back to ".git" when setting GIT_DIR
  remote: avoid reading $GIT_DIR config in non-repo
</content>
</entry>
<entry>
<title>remote: avoid reading $GIT_DIR config in non-repo</title>
<updated>2017-02-14T21:13:59Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-02-14T20:33:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4539c218c362f2c1a26c61b1aa57af10342fd5a4'/>
<id>urn:sha1:4539c218c362f2c1a26c61b1aa57af10342fd5a4</id>
<content type='text'>
The "git ls-remote" command can be run outside of a
repository, but needs to look up configured remotes. The
config code is smart enough to handle this case itself, but
we also check the historical "branches" and "remotes" paths
in $GIT_DIR. The git_path() function causes us to blindly
look at ".git/remotes", even if we know we aren't in a git
repository.

For now, this is just an unlikely bug (you probably don't
have such a file if you're not in a repository), but it will
become more obvious once we merge b1ef400ee (setup_git_env:
avoid blind fall-back to ".git", 2016-10-20):

  [now]
  $ git ls-remote
  fatal: No remote configured to list refs from.

  [with b1ef400ee]
  $ git ls-remote
  fatal: BUG: setup_git_env called without repository

We can fix this by skipping these sources entirely when
we're outside of a repository.

The test is a little more complex than the demonstration
above. Rather than detect the correct behavior by parsing
the error message, we can actually set up a case where the
remote name we give is a valid repository, but b1ef400ee
would cause us to die in the configuration step.

This test doesn't fail now, but it future-proofs us for the
b1ef400ee change.

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 'km/branch-get-push-while-detached' into maint</title>
<updated>2017-01-31T21:32:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-01-31T21:32:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f5f55a1046d85bd78244d25617358f48619785f8'/>
<id>urn:sha1:f5f55a1046d85bd78244d25617358f48619785f8</id>
<content type='text'>
"git &lt;cmd&gt; @{push}" on a detached HEAD used to segfault; it has
been corrected to error out with a message.

* km/branch-get-push-while-detached:
  branch_get_push: do not segfault when HEAD is detached
</content>
</entry>
<entry>
<title>Merge branch 'js/remote-rename-with-half-configured-remote'</title>
<updated>2017-01-31T21:14:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-01-31T21:14:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fe575f06532bde1e672a2313fd76ef09b66fc355'/>
<id>urn:sha1:fe575f06532bde1e672a2313fd76ef09b66fc355</id>
<content type='text'>
With anticipatory tweaking for remotes defined in ~/.gitconfig
(e.g. "remote.origin.prune" set to true, even though there may or
may not actually be "origin" remote defined in a particular Git
repository), "git remote rename" and other commands misinterpreted
and behaved as if such a non-existing remote actually existed.

* js/remote-rename-with-half-configured-remote:
  remote rename: more carefully determine whether a remote is configured
  remote rename: demonstrate a bogus "remote exists" bug
</content>
</entry>
<entry>
<title>remote rename: more carefully determine whether a remote is configured</title>
<updated>2017-01-19T22:04:23Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2017-01-19T21:20:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e459b073fb3ab8abe36e6bee5c5d6be1ed3928ae'/>
<id>urn:sha1:e459b073fb3ab8abe36e6bee5c5d6be1ed3928ae</id>
<content type='text'>
One of the really nice features of the ~/.gitconfig file is that users
can override defaults by their own preferred settings for all of their
repositories.

One such default that some users like to override is whether the
"origin" remote gets auto-pruned or not. The user would simply call

	git config --global remote.origin.prune true

and from now on all "origin" remotes would be pruned automatically when
fetching into the local repository.

There is just one catch: now Git thinks that the "origin" remote is
configured, even if the repository config has no [remote "origin"]
section at all, as it does not realize that the "prune" setting was
configured globally and that there really is no "origin" remote
configured in this repository.

That is a problem e.g. when renaming a remote to a new name, when Git
may be fooled into thinking that there is already a remote of that new
name.

Let's fix this by paying more attention to *where* the remote settings
came from: if they are configured in the local repository config, we
must not overwrite them. If they were configured elsewhere, we cannot
overwrite them to begin with, as we only write the repository config.

There is only one caller of remote_is_configured() (in `git fetch`) that
may want to take remotes into account even if they were configured
outside the repository config; all other callers essentially try to
prevent the Git command from overwriting settings in the repository
config.

To accommodate that fact, the remote_is_configured() function now
requires a parameter that states whether the caller is interested in all
remotes, or only in those that were configured in the repository config.

Many thanks to Jeff King whose tireless review helped with settling for
nothing less than the current strategy.

This fixes https://github.com/git-for-windows/git/issues/888

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 'km/branch-get-push-while-detached'</title>
<updated>2017-01-18T23:12:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-01-18T23:12:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b85f79c7dd35b495ce94bf58b61832c6030751cf'/>
<id>urn:sha1:b85f79c7dd35b495ce94bf58b61832c6030751cf</id>
<content type='text'>
"git &lt;cmd&gt; @{push}" on a detached HEAD used to segfault; it has
been corrected to error out with a message.

* km/branch-get-push-while-detached:
  branch_get_push: do not segfault when HEAD is detached
</content>
</entry>
<entry>
<title>branch_get_push: do not segfault when HEAD is detached</title>
<updated>2017-01-08T03:20:07Z</updated>
<author>
<name>Kyle Meyer</name>
<email>kyle@kyleam.com</email>
</author>
<published>2017-01-07T01:12:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b10731f43dc21fa47c275052e7c074c686335cd3'/>
<id>urn:sha1:b10731f43dc21fa47c275052e7c074c686335cd3</id>
<content type='text'>
Move the detached HEAD check from branch_get_push_1() to
branch_get_push() to avoid setting branch-&gt;push_tracking_ref when
branch is NULL.

Signed-off-by: Kyle Meyer &lt;kyle@kyleam.com&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use strbuf_addstr() for adding constant strings to a strbuf, part 2</title>
<updated>2016-09-15T19:23:38Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2016-09-15T18:31:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a22ae753cb297cb8a1e3ae950ae4415190cd51d5'/>
<id>urn:sha1:a22ae753cb297cb8a1e3ae950ae4415190cd51d5</id>
<content type='text'>
Replace uses of strbuf_addf() for adding strings with more lightweight
strbuf_addstr() calls.  This makes the intent clearer and avoids
potential issues with printf format specifiers.

02962d36845b89145cd69f8bc65e015d78ae3434 already converted six cases,
this patch covers eleven more.

A semantic patch for Coccinelle is included for easier checking for
new cases that might be introduced in the future.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/push-force-with-lease-creation' into maint</title>
<updated>2016-09-09T04:35:53Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-09-09T04:35:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f34d900aa7346592a9d7fd2eb7b21126fd9732d5'/>
<id>urn:sha1:f34d900aa7346592a9d7fd2eb7b21126fd9732d5</id>
<content type='text'>
"git push --force-with-lease" already had enough logic to allow
ensuring that such a push results in creation of a ref (i.e. the
receiving end did not have another push from sideways that would be
discarded by our force-pushing), but didn't expose this possibility
to the users.  It does so now.

* jk/push-force-with-lease-creation:
  t5533: make it pass on case-sensitive filesystems
  push: allow pushing new branches with --force-with-lease
  push: add shorthand for --force-with-lease branch creation
  Documentation/git-push: fix placeholder formatting
</content>
</entry>
<entry>
<title>push: allow pushing new branches with --force-with-lease</title>
<updated>2016-07-26T20:48:28Z</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2016-07-26T20:44:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=64ac39af7020f3a8bc52d51137804ce9f46baf66'/>
<id>urn:sha1:64ac39af7020f3a8bc52d51137804ce9f46baf66</id>
<content type='text'>
If there is no upstream information for a branch, it is likely that it
is newly created and can safely be pushed under the normal fast-forward
rules.  Relax the --force-with-lease check so that we do not reject
these branches immediately but rather attempt to push them as new
branches, using the null SHA-1 as the expected value.

In fact, it is already possible to push new branches using the explicit
--force-with-lease=&lt;branch&gt;:&lt;expect&gt; syntax, so all we do here is make
this behaviour the default if no explicit "expect" value is specified.

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
