[PATCH 2/4] imap-send: check NULL return of SSL_CTX_new()

2016-04-08 Thread Kazuki Yamaguchi
SSL_CTX_new() may fail with return value NULL. Signed-off-by: Kazuki Yamaguchi --- imap-send.c | 4 1 file changed, 4 insertions(+) diff --git a/imap-send.c b/imap-send.c index 0364b326e109..c5e24a35491d 100644 --- a/imap-send.c +++ b/imap-send.c @@ -298,6 +298,10 @@ static int

[PATCH 3/4] imap-send: avoid deprecated TLSv1_method()

2016-04-08 Thread Kazuki Yamaguchi
() for now (this is aliased to TLS_method()). Signed-off-by: Kazuki Yamaguchi --- imap-send.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/imap-send.c b/imap-send.c index c5e24a35491d..f53380562c4d 100644 --- a/imap-send.c +++ b/imap-send.c @@ -287,11 +287,7 @@ static

[PATCH 1/4] imap-send: use HMAC() function provided by OpenSSL

2016-04-08 Thread Kazuki Yamaguchi
Fix compile errors with OpenSSL 1.1.0. HMAC_CTX is made opaque and HMAC_CTX_cleanup is removed in OpenSSL 1.1.0. But since we just want to calculate one HMAC, we can use HMAC() here, which exists since OpenSSL 0.9.6 at least. Signed-off-by: Kazuki Yamaguchi --- Since I don't have OS X mac

[PATCH 4/4] configure: remove checking for HMAC_CTX_cleanup

2016-04-08 Thread Kazuki Yamaguchi
We don't need it, as we no longer use HMAC_CTX_cleanup() directly. Signed-off-by: Kazuki Yamaguchi --- Makefile | 6 -- configure.ac | 4 git-compat-util.h | 3 --- 3 files changed, 13 deletions(-) diff --git a/Makefile b/Makefile index 2742a6977c6a..47ccb0042591 1

[PATCH 0/4] fix compilation with OpenSSL 1.1.0-pre4

2016-04-08 Thread Kazuki Yamaguchi
/2016-March/67.html [2] https://www.openssl.org/policies/releasestrat.html Kazuki Yamaguchi (4): imap-send: use HMAC() function provided by OpenSSL imap-send: check NULL return of SSL_CTX_new() imap-send: avoid deprecated TLSv1_method() configure: remove checking for HMAC_CTX_cleanup Mak

[PATCH 0/2] imap-send: fixes for CRAM-MD5 authentication

2016-04-08 Thread Kazuki Yamaguchi
[1/2] Check for LOGINDISABLED capability only when using LOGIN command, as it is unrelated to authentication with CRAM-MD5. [2/2] Remove extra + 1, which is probably mistakenly added. Without this patch I can't open my IMAP server (Dovecot 2.2). Thanks, Kazuki Yamaguchi (2): imap-send:

[PATCH 1/2] imap-send: check for NOLOGIN capability only when using LOGIN command

2016-04-08 Thread Kazuki Yamaguchi
Don't check for NOLOGIN (LOGINDISABLED) capability when imap.authMethod is specified. LOGINDISABLED capability doesn't forbid using AUTHENTICATE, so it should be allowed, or we can't connect to IMAP servers which only accepts AUTHENTICATE command. Signed-off-by: Kazuki Yamag

[PATCH 2/2] imap-send: fix CRAM-MD5 response calculation

2016-04-08 Thread Kazuki Yamaguchi
Remove extra + 1 from resp_len, the length of the byte sequence to be Base64 encoded and passed to the server as the response. Or the response incorrectly contains an extra \0. Signed-off-by: Kazuki Yamaguchi --- imap-send.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH] set_worktree_head_symref(): fix error message

2016-04-08 Thread Kazuki Yamaguchi
branch -m oldname newname error: error: HEAD of working tree /path/to/wt is not updated fatal: Branch renamed to newname, but HEAD is not updated! Thanks to Eric Sunshine for pointing this out. Signed-off-by: Kazuki Yamaguchi --- I'm sorry, this is my mistake in my previous patch whi

Re: [PATCH v3 1/2] refs: add a new function set_worktree_head_symref

2016-04-07 Thread Kazuki Yamaguchi
On Thu, Apr 07, 2016 at 05:20:10PM -0400, Eric Sunshine wrote: > On Sun, Mar 27, 2016 at 10:37 AM, Kazuki Yamaguchi wrote: > > Add a new function set_worktree_head_symref, to update HEAD symref for > > the specified worktree. > > > > To update HEAD of a linked work

[PATCH v3] branch -d: refuse deleting a branch which is currently checked out

2016-03-29 Thread Kazuki Yamaguchi
x27;s HEAD. Helped-by: Eric Sunshine Signed-off-by: Kazuki Yamaguchi --- Changes from v2: - Amended commit message - Dropped "which is" from error message The previous versions of the patch are: - [v1] http://thread.gmane.org/gmane.comp.version-control.git/289413/focus=2899

Re: [PATCH v2] branch -d: refuse deleting a branch which is currently checked out

2016-03-29 Thread Kazuki Yamaguchi
On Mon, Mar 28, 2016 at 12:51:21PM -0400, Eric Sunshine wrote: > On Mon, Mar 28, 2016 at 3:22 AM, Kazuki Yamaguchi wrote: > > When a branch is checked out by current working tree, deleting the > > branch is forbidden. However when the branch is checked out only by > >

[PATCH v2] branch -d: refuse deleting a branch which is currently checked out

2016-03-28 Thread Kazuki Yamaguchi
HEAD. Signed-off-by: Kazuki Yamaguchi --- % git worktree list /path/to 2c3c5f2 [master] /path/to/wt 2c3c5f2 [branch-a] % git branch -d branch-a error: Cannot delete the branch 'branch-a' which is currently checked out at '/path/to/wt' builtin/branch.c | 22

Re: [PATCH v2 5/5] branch -d: refuse deleting a branch which is currently checked out

2016-03-28 Thread Kazuki Yamaguchi
On Sun, Mar 27, 2016 at 01:52:18PM -0400, Eric Sunshine wrote: > On Fri, Mar 25, 2016 at 2:28 PM, Kazuki Yamaguchi wrote: > > When a branch is checked out by current working tree, deleting the > > branch is forbidden. However when the branch is checked out only by > >

[PATCH v3 0/2] update all per-worktree HEADs when renaming a branch

2016-03-27 Thread Kazuki Yamaguchi
replace_each_worktree_head_symref(), to avoid confusion with set_worktree_head_symref() added by [1/2]. Thanks, Kazuki Yamaguchi (2): refs: add a new function set_worktree_head_symref branch -m: update all per-worktree HEADs branch.c | 23 +++ branch.h | 7

[PATCH v3 2/2] branch -m: update all per-worktree HEADs

2016-03-27 Thread Kazuki Yamaguchi
ating all relevant worktree HEADs when renaming a branch. Signed-off-by: Kazuki Yamaguchi --- branch.c | 23 +++ branch.h | 7 +++ builtin/branch.c | 3 +-- t/t3200-branch.sh | 23 ++- 4 files changed, 53 insertions(+), 3 dele

[PATCH v3 1/2] refs: add a new function set_worktree_head_symref

2016-03-27 Thread Kazuki Yamaguchi
working tree, it is unusable because it uses $GIT_DIR for worktree-specific symrefs (HEAD). The new function takes git_dir (real directory) as an argument, and updates HEAD of the working tree. This function will be used when renaming a branch. Signed-off-by: Kazuki Yamaguchi --- refs.h

Re: [PATCH v2 0/5] branch: fix branch operations with multiple working trees

2016-03-27 Thread Kazuki Yamaguchi
On Fri, Mar 25, 2016 at 02:13:07PM -0700, Junio C Hamano wrote: > Kazuki Yamaguchi writes: > > > [1/5] > > Adds RESOLVE_REF_COMMON_DIR to resolve_ref_unsafe(). The second - fourth > > patch depend on this. At the same time, this allows us to remove > > reimplementat

[PATCH v2 3/5] refs: add create_symref_common_dir as a variation of create_symref

2016-03-25 Thread Kazuki Yamaguchi
main working tree's HEAD regardless of where we are. This will be needed when renaming a branch. Signed-off-by: Kazuki Yamaguchi --- refs.h | 3 +++ refs/files-backend.c | 17 ++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/refs.h b/refs.h

[PATCH v2 5/5] branch -d: refuse deleting a branch which is currently checked out

2016-03-25 Thread Kazuki Yamaguchi
HEAD. Signed-off-by: Kazuki Yamaguchi --- builtin/branch.c | 12 +++- t/t3200-branch.sh | 6 ++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/builtin/branch.c b/builtin/branch.c index 31eb473d3e6a..e64aa68cf722 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@

[PATCH v2 2/5] refs: add REF_COMMON_DIR flag

2016-03-25 Thread Kazuki Yamaguchi
Add a flag to force using $GIT_COMMON_DIR, instead of selecting $GIT_DIR or $GIT_COMMON_DIR by refname. This allows updating worktree-specific refs of the main working tree from a linked working tree. We will use this later. Signed-off-by: Kazuki Yamaguchi --- refs.h | 4

[PATCH v2 4/5] branch -m: update all per-worktree HEADs

2016-03-25 Thread Kazuki Yamaguchi
dating all relevant worktree HEADs when renaming a branch. Signed-off-by: Kazuki Yamaguchi --- branch.c | 32 branch.h | 7 +++ builtin/branch.c | 3 +-- t/t3200-branch.sh | 23 ++- 4 files changed, 62 insertions(+), 3

[PATCH v2 0/5] branch: fix branch operations with multiple working trees

2016-03-25 Thread Kazuki Yamaguchi
is same. This can be applied separately. Kazuki Yamaguchi (5): refs: add new flag RESOLVE_REF_COMMON_DIR to resolve_ref_unsafe refs: add REF_COMMON_DIR flag refs: add create_symref_common_dir as a variation of create_symref branch -m: update all per-worktree HEADs branch -d: refuse deleting

[PATCH v2 1/5] refs: add new flag RESOLVE_REF_COMMON_DIR to resolve_ref_unsafe

2016-03-25 Thread Kazuki Yamaguchi
simplified one for this purpose, and this patch allows removing it. Signed-off-by: Kazuki Yamaguchi --- refs.h | 4 ++ refs/files-backend.c | 5 ++- worktree.c | 105 --- 3 files changed, 41 insertions(+), 73 deletions(-) diff

Re: [PATCH] branch: update all per-worktree HEADs when renaming a branch

2016-03-25 Thread Kazuki Yamaguchi
On Tue, Mar 22, 2016 at 07:49:00AM +0700, Duy Nguyen wrote: > On Tue, Mar 22, 2016 at 12:41 AM, Eric Sunshine > wrote: > >> diff --git a/worktree.c b/worktree.c > >> @@ -217,3 +217,41 @@ char *find_shared_symref(const char *symref, const > >> char *target) > >> +int update_worktrees_head_symref(

Re: [PATCH] branch: update all per-worktree HEADs when renaming a branch

2016-03-25 Thread Kazuki Yamaguchi
Hello, On 03/22/2016 03:41 AM, Eric Sunshine wrote: >> diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh >> @@ -126,7 +126,19 @@ test_expect_success 'git branch -M foo bar should fail >> when bar is checked out' >> test_expect_success 'git branch -M baz bam should succeed when baz is >> check

[PATCH] branch: update all per-worktree HEADs when renaming a branch

2016-03-21 Thread Kazuki Yamaguchi
dating all relevant worktree HEADs when renaming a branch. Signed-off-by: Kazuki Yamaguchi --- builtin/branch.c | 4 ++-- t/t3200-branch.sh | 14 +- worktree.c| 38 ++ worktree.h| 7 +++ 4 files changed, 60 insertions(+), 3