Commit Briefs

7abf18632a Thomas Adam

got: further fetch tweaks to prevent unintended fetches

Implement stsp's suggestion to only fetch remote's HEAD if the symref refs/remote/*/HEAD exists, and its target no longer matches the remote HEAD. This ensures users tracking a project won't miss a change in HEAD, while also fixing the issue reported by naddy where HEAD was fetched by default even though a specific, potentially less active, branch is cloned, resulting in a repository with more commits than necessary. In addition, unless 'got fetch -b <branch>' is used, the remote HEAD branch will be fetched if branches are not set in got.conf and there is no work tree to ascertain a branch, or said branches are not found on the server. ok stsp@


e0380e3dfa Thomas Adam

special case 'got fetch -b <branch>' to only fetch <branch>

As discussed on irc, this drops the implicit remote HEAD fetch when -b is used. got.1 has been updated to make the new fetch behaviour clear. ok stsp@


9d0a7ee351 Thomas Adam

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


baf8297852 Stefan Sperling

remove declaration of got_fetch_parse_uri()


77d7d3bb1a Stefan Sperling

de-duplicate a constant used by both 'got fetch' and 'got send'

Both GOT_FETCH_PKTMAX and GOT_SEND_PKTMAX had the same value. Declare this value as GOT_PKT_MAX in got_lib_pkt.h instead.


d65a88a2f0 Stefan Sperling

move duplicated dial_ssh() and dial_git() functions into a common file

These functions are used by 'got send' and 'got fetch' in order to open network connections to a server. Move them into new file lib/dial.c and declare relevant functions in got_dial.h and lib/got_lib_dial.h. No functional change.




9c52365fc3 Stefan Sperling

properly terminate the ssh process after fetching via SSH






f1c6967f90 Stefan Sperling

fix chopped display of git-server's progress output


7848a0e165 Stefan Sperling

implement 'got fetch'




ee448f5f10 Stefan Sperling

apply unveil(2) to 'got clone'


668a20f6fe Stefan Sperling

rewritten got-index-pack; sorry about the monster commit


baa9fea074 Stefan Sperling

send indexing progress via an imsg


d2cdc63664 Stefan Sperling

send pack file download progress information over imsg



a78567c6d6 Stefan Sperling

document fetch API functions


ceee4c0f4a Stefan Sperling

remove unused arguments from got_fetch_pack()


07e52fce86 Stefan Sperling

rename got_fetch() to got_fetch_pack()