Skip to content

git remote: set-head and new show output

Jay Soffian git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest21 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/21test scripts: refactor start_httpd helpert/lib-httpd.sh t/t5540-http-push.sh+8 -90 replies
2/21add basic http clone/fetch testsMakefile t/t5540-http-push.sh t/t5550-http-fetch.sh+48 -00 replies
3/21refactor find_ref_by_name() to accept const listcache.h refs.c+3 -30 replies
4/21move duplicated get_local_heads() to remote.cbuiltin-send-pack.c http-push.c remote.c +1 more+31 -480 replies
5/21move duplicated ref_newer() to remote.cbuiltin-send-pack.c http-push.c remote.c +1 more+50 -990 replies
6/21move locate_head() to remote.cbuiltin-clone.c remote.c remote.h+49 -380 replies
7/21remote: simplify guess_remote_head()builtin-clone.c remote.c remote.h+16 -320 replies
8/21remote: let guess_remote_head() optionally return all matchesbuiltin-clone.c remote.c remote.h+35 -177 replies
8/21remote: let guess_remote_head() optionally return all matchesbuiltin-clone.c remote.c remote.h+28 -170 replies
9/21remote: make match_refs() copy src ref before assigning to peer_refremote.c+5 -20 replies
10/21remote: make match_refs() not short-circuitremote.c+4 -20 replies
11/21string-list: new for_each_string_list() functionstring-list.c string-list.h+15 -00 replies
12/21builtin-remote: refactor duplicated cleanup codebuiltin-remote.c+9 -80 replies
13/21builtin-remote: remove unused code in get_ref_statesbuiltin-remote.c+3 -100 replies
14/21builtin-remote: rename variables and eliminate redundant function callbuiltin-remote.c+12 -120 replies
15/21builtin-remote: make get_remote_ref_states() always populate states.trackedbuiltin-remote.c+16 -170 replies
16/21builtin-remote: fix two inconsistencies in the output of "show <remote>"builtin-remote.c t/t5505-remote.sh+11 -60 replies
17/21builtin-remote: teach show to display remote HEADbuiltin-remote.c t/t5505-remote.sh+59 -70 replies
18/21builtin-remote: add set-head subcommandDocumentation/git-remote.txt builtin-remote.c contrib/completion/git-completion.bash +1 more+129 -30 replies
19/21remote: make guess_remote_head() use exact HEAD lookup if it is availableremote.c t/t5550-http-fetch.sh+21 -00 replies
19/21remote: make guess_remote_head() use exact HEAD lookup if it is availableremote.c t/t5550-http-fetch.sh+19 -00 replies
20/21builtin-remote: new show output stylebuiltin-remote.c t/t5505-remote.sh+157 -590 replies
21/21builtin-remote: new show output style for push refspecsbuiltin-remote.c t/t5505-remote.sh+207 -240 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/21] git remote: set-head and new show output

This series replaces three related topics from pu:

js/remote-set-head
jk/head-lookup
js/remote-display

It is based on master. I re-ordered the original commits such that all the refactoring outside of builtin-remote is done first, followed by some small cleanups of builtin-remote itself, and finally ending with the new builtin-remote functionality (set-head) and changes to its "show" output. I think it is easier to review this way and the history will be cleaner.

The end result is largely unchanged from what is currently in pu, but the intermediate results obviously differ to account for the re-ordering. I've verified that each intermediate result compiles and passes t5505-remote.sh. I also ran the full test-suite after the first group of refactoring, and again at the end.

I've diffed each of the changed files at the end of this series against what is currently in pu to verify I didn't miss anything and I saw nothing of note.

So I think this series is clean, and doesn't need an extensive re-review, but a quick look-over would be appreciated.

I signed off on Jeff's patches; please remove my SoB from those if it is inappropriate for me to have done so.

Thanks,

j.

Jay Soffian (17):
move duplicated get_local_heads() to remote.c
move duplicated ref_newer() to remote.c
move locate_head() to remote.c
remote: simplify guess_remote_head()
remote: let guess_remote_head() optionally return all matches
remote: make match_refs() copy src ref before assigning to peer_ref
remote: make match_refs() not short-circuit
string-list: new for_each_string_list() function
builtin-remote: refactor duplicated cleanup code
builtin-remote: remove unused code in get_ref_states
builtin-remote: rename variables and eliminate redundant function call
builtin-remote: make get_remote_ref_states() always populate states.tracked
builtin-remote: fix two inconsistencies in the output of "show <remote>"
builtin-remote: teach show to display remote HEAD
builtin-remote: add set-head subcommand
builtin-remote: new show output style
builtin-remote: new show output style for push refspecs

Jeff King (4):
test scripts: refactor start_httpd helper
add basic http clone/fetch tests
refactor find_ref_by_name() to accept const list
remote: make guess_remote_head() use exact HEAD lookup if it is available

 Documentation/git-remote.txt           |   28 ++-
 Makefile                               |    1 +
 builtin-clone.c                        |   41 +---
 builtin-remote.c                       |  563 ++++++++++++++++++++++++++------
 builtin-send-pack.c                    |   79 +-----
 cache.h                                |    2 +-
 contrib/completion/git-completion.bash |    2 +-
 http-push.c                            |   72 +----
 refs.c                                 |    4 +-
 remote.c                               |  136 ++++++++-
 remote.h                               |   12 +
 string-list.c                          |   10 +
 string-list.h                          |    5 +
 t/lib-httpd.sh                         |    9 +-
 t/t5505-remote.sh                      |  114 +++++--
 t/t5540-http-push.sh                   |    9 +-
 t/t5550-http-fetch.sh                  |   57 ++++
 17 files changed, 818 insertions(+), 326 deletions(-)
 create mode 100755 t/t5550-http-fetch.sh