Commits
- Commit:
885e96dfba200f362ddd1d9795740251bcb6e39b
- From:
- Christian Weisgerber <naddy@mips.inka.de>
- Date:
regress: replace "sed -i" with ed(1) for portable in-place editing
"sed -i" is fundamentally unportable. GNU and OpenBSD sed(1) treat
the extension for the backup file as an optional argument and use
"sed -i" for no backup file. FreeBSD sed(1) treats the extension
as an obligatory argument and uses "sed -i ''" for no backup file.
There is no single syntax that works for both.
ok stsp op
- Commit:
1a0d06a3c2608bd281c3c156a9b008508983decf
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix "got fetch" hang against out-of-date remote repositories
Do not assume that remote repositories will always have our objects.
In Git protocol terms: Do not wait for an ACK from the server before
sending the final "done" message. Otherwise servers might be waiting
for more have-lines from us in order to find a common ancestor, which
will never be sent by us.
Problem reported by James Cook who also provided an initial test case
ok op@
- Commit:
bf1c78e5100932aa445b8ef07ebf9b712500c67e
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
update regress for fetch tweaks added in previous commit
ok stsp@
- Commit:
ac51614e087279834159667c6f71fffe546cffa6
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
keep regress testname copypasta fix from 2a19e2e21a
s/fetch_branch/fetch_honor_wt_conf_bflag so we don't report the wrong
test in the case of failure. The incorrect testname was introduced in
1cb79834ea as the result of too much copypasta. It was subsequently
fixed in 2a19e2e21a but then backed-out.
- Commit:
4bff57b4b66990d6829cb83645d1f1d478ae0cea
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
backout got: always fetch remote HEAD except when -b is used
As pointed out by naddy, this behaviour is not ideal when users
want to limit their repository to a particular branch which will
diverge from HEAD over time, such as -stable branches.
See https://marc.gameoftrees.org/mail/1676388048.8632_0.html
- Commit:
2a19e2e21a876bbc4ae1999ca08ce4c8f2002158
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
got: always fetch remote HEAD except when -b is used
Rather than only fetch HEAD when there are no branches set in got.conf and
there is no branch to be inferred from a work tree, or said branches don't
exist on the server, always fetch HEAD unless 'got fetch -b branch' is used.
ok stsp@
- Commit:
f72ce919dd6d6c15679c5174c47912ac55be1e18
- From:
- Stefan Sperling <stsp@stsp.name>
- Via:
- Mark Jamsek <mark@jamsek.dev>
- Date:
make 'got fetch -b branch' error reporting more helpful
The patch to got-fetch-pack.c was written by stsp with only minor tweaks
by me. Regress updated to account for the change in reporting.
stsp's original got-fetch-pack.c diff ok op jamsek
ok stsp@
- Commit:
1cb79834eab33d1c1c01731b4800bab440032f20
- From:
- Mark Jamsek <mark@jamsek.dev>
- Date:
regress: fetch -b/got.conf/wt/remote HEAD interaction
The added test checks we honour the correct precedence of branches to be
fetched, which is determined by: the -b flag; branches set in got.conf;
the work tree's current branch; and the remote repository's HEAD branch.
If a branch is specified with -b, only fetch this branch and if it does
not exist, simply report to the user--do not fallback to other branches.
Otherwise, if branches are either not set in got.conf or are set but do
not exist on the server:
- if invoked in a work tree, fallback to the work tree's current branch
- if not in a work tree or the work tree's current branch does not exist
on the server:
- fallback to remote HEAD.
With this, only the -b case can result in an unsuccessful fetch due to the
requested branch(es) not existing on the server. All other cases will either
fetch updates or report "Already up-to-date" (excepting errors).
ok stsp@
- Commit:
188f8dcf2c1c15bf37859e3b587bc6331fd5a097
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix interaction of 'got fetch -b', got.conf, and work tree
Without branches in got.conf for a remote, and without -b/-R options,
the fallback to HEAD would only work when not invoked in a work tree.
With this fix 'got fetch' should behave as described in the man page.
The -b option now overrides both got.conf and the fallback to the work
tree's branch.
And fallback to HEAD works as expected when invoked in a repository.
Also, do not strictly require remote repositories to provide a branch
from the refs/heads/ namespace. In such cases users should be able to
use -R to select something to fetch.
ok jamsek
- Commit:
ccbbf026bf5917a8d66564fcce9184b29412432b
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
improve 'got fetch' behaviour when work tree's branch is not on server
Only fetch the work tree's branch if the -b option is not specified.
This keeps -b functional as an override when invoked in a work tree.
Our previous changes did not consider that got.conf is also a source
of lists of branches to fetch, and that -b is supposed to work as an
override of any default behaviour. We were implicitly appending the
work tree's branch as if it was mentioned as an override on the
command line, which was wrong and based on a misunderstanding of
the intended behaviour.
Without -b on the command line we obtain a list of branches to fetch
from got.conf and use this list if it is not empty. The repository's
HEAD will be fetched only if neither the -b option, nor got.conf, nor
a work tree tell us what to fetch.
Make the man page more clear by moving the explanation of the default
behaviour into the main section of 'got fetch', leaving the -a and -b
option descriptions free of such details.
ok jamsek
- Commit:
0c091d87ab17ea31491f4b716ce8b6f0fbb99001
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add test coverage for new 'got fetch' default behaviour
- Commit:
842467521f94def2d4cce96b3c39f8bbad73bd0b
- From:
- Omar Polo <op@omarpolo.com>
- Date:
set `ret' in a few places where it was forgotten; ok tracey@
- Commit:
49c543a6fe888394ca86e6399c706a9965486134
- From:
- Christian Weisgerber <naddy@mips.inka.de>
- Date:
use test(1) -eq and -ne to compare integers, and reduce quoting
This brings the rest of the regression test scripts in line with
patch.sh.
- Commit:
1b796c3fa88f0d3101f3dd979d9f8b511fd93086
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix a null-pointer deref in 'got fetch -d'; reported by Omar Polo
- Commit:
678d8c1fe20f1eab5a3568135b24f00c9d22c33c
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
fix name of temporary directory used by test_fetch_delete_remote_refs
- Commit:
978a28a108ecdc501cf03dade3215aed24981a12
- From:
- Christian Weisgerber <naddy@mips.inka.de>
- Date:
make "got branch -d" print reference name and value
Also silence output of "got branch -d" in a regression test, from stsp.
ok stsp
- Commit:
3379373c62efb02a719d4b6e040189f348470f0a
- From:
- Christian Weisgerber <naddy@mips.inka.de>
- Date:
use POSIX [ s1 = s2 ] syntax instead of [ s1 == s2 ]
- Commit:
161728eb26bf63ad53f11367358ea6190bad8968
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add 'got fetch -X' option for deleting references created by 'got fetch'
- Commit:
993f033b6f1d781a4ba7970fec46915d08e53502
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
make 'got ref -d' print reference name and value like the new -X options do
- Commit:
99495ddb79841fe89b0746d35a49bb81e9220096
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
add a 'reference' directive to remote repositories in got.conf(5)
Make use of this in 'got clone' to persist -R option arguments given on
the command line in the cloned repository's got.conf(5) file.
- Commit:
98f64f14c3dc52ec6afc00acc53dc9f42399d363
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
work around spurious ACK responses from git servers in got-fetch-pack
The Git server can apparently send duplicate ACK responses even though we
do not enable the multi_ack capability. According to the Git protocol docs
the server should only send ACKs after receiving 'done' from the client if
multi_ack has been enabled.
However, a duplicate ACK response can be triggered by running 'got fetch -a'
in our fetch_update_tag test. This resulted in the following error:
got-fetch-pack: unknown side-band received from server
got: bad packet received
- Commit:
612392ee9a232ecb6f4f9db91eafbe6693509bd9
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
allow the 'got fetch' -l option together with the -q option
Make use of this in tests to hide useless output from ssh(1).
- Commit:
15d3c221e34cad474e87c43111417186822c887c
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
make 'got clone' pin the fetched branch in got.conf(5)
Avoids relying on the server-side HEAD ref by default during future fetches.
- Commit:
54c39596938ae6d19fe5eede072d36a3f61baa12
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
use POSIX [s1 = s2] syntax instead of [s1 == s2]; patch by Ryo ONODERA
- Commit:
54eb00d5beb979ca755db29889d236201e53cd52
- From:
- Stefan Sperling <stsp@stsp.name>
- Date:
properly handle nonexistent remote repository names given to 'got fetch'
found by jrick
ok naddy