From e14712c9e6801855a033ee1e7013f54580f270a1 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Thu, 30 Sep 2010 17:31:43 +0200 Subject: [PATCH 1/4] rev-list-options: clarify --parents and --children Make it clearer that --parents resp. --children list the parent resp. child commits next to each commit, so that I understand next time. Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- Documentation/rev-list-options.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt index e2237ae4a0a80b..ebc0108731dffd 100644 --- a/Documentation/rev-list-options.txt +++ b/Documentation/rev-list-options.txt @@ -45,13 +45,13 @@ endif::git-rev-list[] --parents:: - Print the parents of the commit. Also enables parent - rewriting, see 'History Simplification' below. + Print also the parents of the commit (in the form "commit parent..."). + Also enables parent rewriting, see 'History Simplification' below. --children:: - Print the children of the commit. Also enables parent - rewriting, see 'History Simplification' below. + Print also the children of the commit (in the form "commit child..."). + Also enables parent rewriting, see 'History Simplification' below. ifdef::git-rev-list[] --timestamp:: From dbda967684dfefd0ac3518f9805ccf9ded9af429 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Mon, 6 Sep 2010 20:50:17 -0500 Subject: [PATCH 2/4] t0004 (unwritable files): simplify error handling Instead of ... normal test script ... status=$? ... cleanup ... (exit $status) set up cleanup commands with test_when_finished. This makes the test script a little shorter, and more importantly, it ensures errors during cleanup are reported. Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- t/t0004-unwritable.sh | 52 ++++++++++++------------------------------- 1 file changed, 14 insertions(+), 38 deletions(-) diff --git a/t/t0004-unwritable.sh b/t/t0004-unwritable.sh index 385b1265de5382..e3137d638ee5bb 100755 --- a/t/t0004-unwritable.sh +++ b/t/t0004-unwritable.sh @@ -16,53 +16,29 @@ test_expect_success setup ' ' test_expect_success POSIXPERM,SANITY 'write-tree should notice unwritable repository' ' - - ( - chmod a-w .git/objects .git/objects/?? && - test_must_fail git write-tree - ) - status=$? - chmod 775 .git/objects .git/objects/?? - (exit $status) - + test_when_finished "chmod 775 .git/objects .git/objects/??" && + chmod a-w .git/objects .git/objects/?? && + test_must_fail git write-tree ' test_expect_success POSIXPERM,SANITY 'commit should notice unwritable repository' ' - - ( - chmod a-w .git/objects .git/objects/?? && - test_must_fail git commit -m second - ) - status=$? - chmod 775 .git/objects .git/objects/?? - (exit $status) - + test_when_finished "chmod 775 .git/objects .git/objects/??" && + chmod a-w .git/objects .git/objects/?? && + test_must_fail git commit -m second ' test_expect_success POSIXPERM,SANITY 'update-index should notice unwritable repository' ' - - ( - echo 6O >file && - chmod a-w .git/objects .git/objects/?? && - test_must_fail git update-index file - ) - status=$? - chmod 775 .git/objects .git/objects/?? - (exit $status) - + test_when_finished "chmod 775 .git/objects .git/objects/??" && + echo 6O >file && + chmod a-w .git/objects .git/objects/?? && + test_must_fail git update-index file ' test_expect_success POSIXPERM,SANITY 'add should notice unwritable repository' ' - - ( - echo b >file && - chmod a-w .git/objects .git/objects/?? && - test_must_fail git add file - ) - status=$? - chmod 775 .git/objects .git/objects/?? - (exit $status) - + test_when_finished "chmod 775 .git/objects .git/objects/??" && + echo b >file && + chmod a-w .git/objects .git/objects/?? && + test_must_fail git add file ' test_done From 8713feb16dd6a472828bbdcf914a1c8f5c6810a2 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 29 Sep 2010 23:22:32 +0100 Subject: [PATCH 3/4] Make sure that git_getpass() never returns NULL The result of git_getpass() is used without checking for NULL, so let's just die() instead of returning NULL. Signed-off-by: Johannes Schindelin Signed-off-by: Pat Thoyts Signed-off-by: Junio C Hamano --- connect.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/connect.c b/connect.c index 3450cabd0e3281..57dc20c43ca1ba 100644 --- a/connect.c +++ b/connect.c @@ -631,8 +631,12 @@ char *git_getpass(const char *prompt) askpass = askpass_program; if (!askpass) askpass = getenv("SSH_ASKPASS"); - if (!askpass || !(*askpass)) - return getpass(prompt); + if (!askpass || !(*askpass)) { + char *result = getpass(prompt); + if (!result) + die_errno("Could not read password"); + return result; + } args[0] = askpass; args[1] = prompt; From 8695353147e0c20fc8197fd73efec2ca9bce0304 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 29 Sep 2010 23:22:33 +0100 Subject: [PATCH 4/4] Fix typo in pack-objects' usage Signed-off-by: Johannes Schindelin Signed-off-by: Pat Thoyts Signed-off-by: Junio C Hamano --- builtin/pack-objects.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 0e8167311884d3..3756cf36ee5dd6 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -30,7 +30,7 @@ static const char pack_usage[] = " [--no-reuse-delta] [--no-reuse-object] [--delta-base-offset]\n" " [--threads=N] [--non-empty] [--revs [--unpacked | --all]*]\n" " [--reflog] [--stdout | base-name] [--include-tag]\n" - " [--keep-unreachable | --unpack-unreachable \n" + " [--keep-unreachable | --unpack-unreachable]\n" " [