From: Tay Ray Chuan <hidden> Date: 2016-06-15 22:48:19
This patch series was generated on top of 'next'. It contains some
general changes to http users.
Some highlights:
- add non-ff test cases to "dumb" http push test
- separate init and cleanup of http from http-walker
[PATCH 1/7] t5541-http-push: check that ref is unchanged for non-ff test
[PATCH 2/7] t554[01]-http-push: refactor, add non-ff tests
[PATCH 3/7] http-push: remove useless condition
[PATCH 4/7] http-walker: cleanup more thoroughly
[PATCH 5/7] http: init and cleanup separately from http-walker
[PATCH 6/7] remote-curl: use http_fetch_ref() instead of walker wrapper
[PATCH 7/7] remote-curl: init walker only when needed
http-fetch.c | 4 +++-
http-push.c | 2 +-
http-walker.c | 21 ++++++++++++++++++---
remote-curl.c | 21 +++++++++------------
t/lib-httpd.sh | 29 +++++++++++++++++++++++++++++
t/t5540-http-push.sh | 3 +++
t/t5541-http-push.sh | 22 ++--------------------
walker.h | 2 +-
8 files changed, 66 insertions(+), 38 deletions(-)
--
Cheers,
Ray Chuan
@@ -1965,7 +1965,7 @@ int main(int argc, char **argv)}if(!hashcmp(ref->old_sha1,ref->peer_ref->new_sha1)){-if(push_verbosely||1)+if(push_verbosely)fprintf(stderr,"'%s': up-to-date\n",ref->name);if(helper_status)printf("ok %s up to date\n",ref->name);
From: Tay Ray Chuan <hidden> Date: 2016-06-15 22:48:19
Invoke get_http_walker() only when fetching with the dumb protocol.
Additionally, add an invocation to walker_free() after we're done using
the walker.
Signed-off-by: Tay Ray Chuan <redacted>
---
remote-curl.c | 13 +++----------
1 files changed, 3 insertions(+), 10 deletions(-)
From: Tay Ray Chuan <hidden> Date: 2016-06-15 22:48:19
Move non-fast forward tests to lib-httpd.sh so that we don't have to
duplicate the tests in both t5540 and t5541.
Signed-off-by: Tay Ray Chuan <redacted>
---
t/lib-httpd.sh | 29 +++++++++++++++++++++++++++++
t/t5540-http-push.sh | 3 +++
t/t5541-http-push.sh | 24 ++----------------------
3 files changed, 34 insertions(+), 22 deletions(-)
@@ -88,28 +88,8 @@ test_expect_success 'used receive-pack service' 'test_cmpexpact'-test_expect_success'non-fast-forward push fails''-cd"$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git&&-HEAD=$(gitrev-parse--verifyHEAD)&&--cd"$ROOT_PATH"/test_repo_clone&&-gitcheckoutmaster&&-echo"changed">path2&&-gitcommit-a-mpath2--amend&&--!(gitpush-vorigin>output2>&1)&&-(cd"$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git&&-test$HEAD=$(gitrev-parse--verifyHEAD))-'--test_expect_success'non-fast-forward push show ref status''-grep"^ ! \[rejected\][ ]*master -> master (non-fast-forward)$"output-'--test_expect_success'non-fast-forward push shows help message''-grep"To prevent you from losing history, non-fast-forward updates were rejected"\-output-'+test_http_push_nonff"$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git\+"$ROOT_PATH"/test_repo_clonemaster test_expect_success'push fails for non-fast-forward refs unmatched by remote helper''# create a dissimilarly-named remote ref so that git is unable to match the
From: Tay Ray Chuan <hidden> Date: 2016-06-15 22:48:19
Previously, all our http operations were done with http-walker. With the
new remote-curl helper, we find ourselves using http methods outside of
http-walker - for example, fetching info/refs.
Accomodate this by separating http_init() and http_cleanup() invocations
from http-walker.
Signed-off-by: Tay Ray Chuan <redacted>
---
http-fetch.c | 5 ++++-
http-walker.c | 4 +---
remote-curl.c | 7 ++++++-
walker.h | 2 +-
4 files changed, 12 insertions(+), 6 deletions(-)
From: Tay Ray Chuan <hidden> Date: 2016-06-15 22:48:19
The http-walker implementation of walker->fetch_ref() doesn't do
anything special compared to http_fetch_ref() anyway.
Remove init_walker() invocation before fetching the ref, since we aren't
using the walker wrapper and don't need a walker instance anymore.
Signed-off-by: Tay Ray Chuan <redacted>
---
remote-curl.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
You changed the order of get_http_walker and http_init. But
Umh, actually you didn't. Sorry about that.
add_fill_function(walker, (int (*)(void *)) fill_active_slot);
already deals with curl functionality. So even though I think it technically
doesn't break, I would prefer if this dependency were still expressed in the
code.
From: Clemens Buchacher <hidden> Date: 2016-06-15 22:48:19
On Sun, Feb 21, 2010 at 11:08:24AM +0800, Tay Ray Chuan wrote:
- if (push_verbosely || 1)
+ if (push_verbosely)
fprintf(stderr, "'%s': up-to-date\n", ref->name);
Just a minor nit-pick. If you end up doing a resend, maybe you could change
the commit message to this one, since you're actually adding a condition
that was previously disabled, not removing it.
Clemens
You changed the order of get_http_walker and http_init. But
add_fill_function(walker, (int (*)(void *)) fill_active_slot);
already deals with curl functionality. So even though I think it technically
doesn't break, I would prefer if this dependency were still expressed in the
code.
From: Tay Ray Chuan <hidden> Date: 2016-08-13 23:25:23
Hi,
On Sun, Feb 21, 2010 at 6:40 PM, Clemens Buchacher [off-list ref] wrote:
On Sun, Feb 21, 2010 at 11:08:24AM +0800, Tay Ray Chuan wrote:
quoted
- if (push_verbosely || 1)
+ if (push_verbosely)
fprintf(stderr, "'%s': up-to-date\n", ref->name);
Just a minor nit-pick. If you end up doing a resend, maybe you could change
the commit message to this one, since you're actually adding a condition
that was previously disabled, not removing it.
From: Tay Ray Chuan <hidden> Date: 2016-08-13 23:25:24
Hi,
On Sun, Feb 21, 2010 at 6:57 PM, Clemens Buchacher [off-list ref] wrote:
On Sun, Feb 21, 2010 at 11:38:20AM +0100, Clemens Buchacher wrote:
quoted
On Sun, Feb 21, 2010 at 11:08:26AM +0800, Tay Ray Chuan wrote:
quoted
diff --git a/http-fetch.c b/http-fetch.c
[...]
add_fill_function(walker, (int (*)(void *)) fill_active_slot);
already deals with curl functionality. So even though I think it technically
doesn't break, I would prefer if this dependency were still expressed in the
code.
quoted
@@ -88,6 +90,7 @@ int main(int argc, const char **argv)
regarding the order of invocation - I could put http_cleanup() after
walker_free().
Perhaps I can express this dependency with a comment in that area in
http-fetch.c and/or http-walker::cleanup()?
Don't invoke http_cleanup() yet, we might still need to perform http
operations in http-walker.
(Separately, on re-reading the code, I noticed that
http-walker::cleanup() calls http_cleanup() again, so I dropped that
invocation from http-walker.)
--
Cheers,
Ray Chuan