Re: Bug in "revision.c: --all adds HEAD from all worktrees" ?

2018-03-13 Thread Stan Hu
To be clear, this is how I think we got into this state:

We have worktrees that are created to squash and rebase a branch. They were 
left around inadvertently for one reason or another.

Since we were using git v2.14.3, a git gc would prune dangling objects because 
it never saw that a worktree still had a reference to it. Now, in git v2.15+, 
worktrees are examined, and a git gc won't garbage collect any objects 
referenced by a worktree.

Another words, the failure of git v2.14 to preserve these objects caused 
problems with these stale worktrees with the upgrade to v2.15+.



[PATCH] upload-pack: Exit when server finishes sending shallow-update in stateless RPC mode

2016-04-11 Thread Stan Hu
In the stateless RPC case, the server should respond to the client's depth
request with the set of commits which are no deeper than the desired
depth. Once this finishes, the server should terminate and receive the reply
in another POST request.

Previously the server would sit idle and die when it detected the client
closed the connection.

Signed-off-by: Stan Hu <sta...@gmail.com>
---
 upload-pack.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/upload-pack.c b/upload-pack.c
index b3f6653..4fb1e60 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -676,6 +676,8 @@ static void receive_needs(void)
register_shallow(object->oid.hash);
}
packet_flush(1);
+   if (stateless_rpc)
+   exit(0);
} else
if (shallows.nr > 0) {
int i;
-- 
2.7.3

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] fetch-pack: Add missing line-feed character when sending depth-request packet line

2016-04-11 Thread Stan Hu
The pkt-line format mandates: "a sender should include a LF, but the
receive MUST NOT complain if it is not present." This patch
is not absolutely necessary since receivers handle the missing the LF,
but this patch adds it for good measure.

Signed-off-by: Stan Hu <sta...@gmail.com>
---
 fetch-pack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fetch-pack.c b/fetch-pack.c
index f96f6df..77299d9 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -330,7 +330,7 @@ static int find_common(struct fetch_pack_args *args,
if (is_repository_shallow())
write_shallow_commits(_buf, 1, NULL);
if (args->depth > 0)
-   packet_buf_write(_buf, "deepen %d", args->depth);
+   packet_buf_write(_buf, "deepen %d\n", args->depth);
packet_buf_flush(_buf);
state_len = req_buf.len;
 
-- 
2.7.3

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html