Re: [PATCH v2] status: show the branch name if possible in in-progress info

2013-01-29 Thread Duy Nguyen
On Wed, Jan 30, 2013 at 1:44 AM, Jonathan Nieder  wrote:
>> - # You are currently rebasing.
>> + # You are currently rebasing branch '\''rebase_conflicts'\'' on 
>> '\''000106f'\''.
>
> SHA1-in-tests radar blinking.
>
> Would it be possible to compute the expected output, as in
>
> dest=$(git rev-parse --short HEAD^^)
> cat >expected <<-EOF &&
> # Not currently on any branch.
> # You are currently rebasing branch '\''rebase_conflicts'\'' on 
> '\''$dest'\''.
>
> ?

That may be better. Yeah.

> I'm not sure what to think about the actual change itself yet.  Can you
> give an example of when you felt the need for this, so it can be
> included in the commit message or documentation?

http://thread.gmane.org/gmane.comp.version-control.git/214932/focus=214937
-- 
Duy
--
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


Re: [PATCH v2] status: show the branch name if possible in in-progress info

2013-01-29 Thread Jonathan Nieder
Hi Duy,

Nguyễn Thái Ngọc Duy wrote:

> --- a/t/t7512-status-help.sh
> +++ b/t/t7512-status-help.sh
> @@ -76,7 +76,7 @@ test_expect_success 'status when rebase in progress before 
> resolving conflicts'
>   test_must_fail git rebase HEAD^ --onto HEAD^^ &&
>   cat >expected <<-\EOF &&
>   # Not currently on any branch.
> - # You are currently rebasing.
> + # You are currently rebasing branch '\''rebase_conflicts'\'' on 
> '\''000106f'\''.

SHA1-in-tests radar blinking.

Would it be possible to compute the expected output, as in

dest=$(git rev-parse --short HEAD^^)
cat >expected <<-EOF &&
# Not currently on any branch.
# You are currently rebasing branch '\''rebase_conflicts'\'' on 
'\''$dest'\''.

?

I'm not sure what to think about the actual change itself yet.  Can you
give an example of when you felt the need for this, so it can be
included in the commit message or documentation?

Thanks.
Jonathan
--
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 v2] status: show the branch name if possible in in-progress info

2013-01-29 Thread Nguyễn Thái Ngọc Duy

Signed-off-by: Nguyễn Thái Ngọc Duy 
---
 - fix bisecting on detached HEAD
 - show onto sha-1 for rebase

 t/t7512-status-help.sh | 36 ++--
 wt-status.c| 91 ++
 wt-status.h|  2 ++
 3 files changed, 105 insertions(+), 24 deletions(-)

diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
index b3f6eb9..67ece6b 100755
--- a/t/t7512-status-help.sh
+++ b/t/t7512-status-help.sh
@@ -76,7 +76,7 @@ test_expect_success 'status when rebase in progress before 
resolving conflicts'
test_must_fail git rebase HEAD^ --onto HEAD^^ &&
cat >expected <<-\EOF &&
# Not currently on any branch.
-   # You are currently rebasing.
+   # You are currently rebasing branch '\''rebase_conflicts'\'' on 
'\''000106f'\''.
#   (fix conflicts and then run "git rebase --continue")
#   (use "git rebase --skip" to skip this patch)
#   (use "git rebase --abort" to check out the original branch)
@@ -102,7 +102,7 @@ test_expect_success 'status when rebase in progress before 
rebase --continue' '
git add main.txt &&
cat >expected <<-\EOF &&
# Not currently on any branch.
-   # You are currently rebasing.
+   # You are currently rebasing branch '\''rebase_conflicts'\'' on 
'\''000106f'\''.
#   (all conflicts fixed: run "git rebase --continue")
#
# Changes to be committed:
@@ -133,7 +133,7 @@ test_expect_success 'status during rebase -i when conflicts 
unresolved' '
test_must_fail git rebase -i rebase_i_conflicts &&
cat >expected <<-\EOF &&
# Not currently on any branch.
-   # You are currently rebasing.
+   # You are currently rebasing branch '\''rebase_i_conflicts_second'\'' 
on '\''e0164e4'\''.
#   (fix conflicts and then run "git rebase --continue")
#   (use "git rebase --skip" to skip this patch)
#   (use "git rebase --abort" to check out the original branch)
@@ -158,7 +158,7 @@ test_expect_success 'status during rebase -i after 
resolving conflicts' '
git add main.txt &&
cat >expected <<-\EOF &&
# Not currently on any branch.
-   # You are currently rebasing.
+   # You are currently rebasing branch '\''rebase_i_conflicts_second'\'' 
on '\''e0164e4'\''.
#   (all conflicts fixed: run "git rebase --continue")
#
# Changes to be committed:
@@ -185,7 +185,7 @@ test_expect_success 'status when rebasing -i in edit mode' '
git rebase -i HEAD~2 &&
cat >expected <<-\EOF &&
# Not currently on any branch.
-   # You are currently editing a commit during a rebase.
+   # You are currently editing a commit while rebasing branch 
'\''rebase_i_edit'\'' on '\''f90e540'\''.
#   (use "git commit --amend" to amend the current commit)
#   (use "git rebase --continue" once you are satisfied with your 
changes)
#
@@ -210,7 +210,7 @@ test_expect_success 'status when splitting a commit' '
git reset HEAD^ &&
cat >expected <<-\EOF &&
# Not currently on any branch.
-   # You are currently splitting a commit during a rebase.
+   # You are currently splitting a commit while rebasing branch 
'\''split_commit'\'' on '\''19b175e'\''.
#   (Once your working directory is clean, run "git rebase --continue")
#
# Changes not staged for commit:
@@ -240,7 +240,7 @@ test_expect_success 'status after editing the last commit 
with --amend during a
git commit --amend -m "foo" &&
cat >expected <<-\EOF &&
# Not currently on any branch.
-   # You are currently editing a commit during a rebase.
+   # You are currently editing a commit while rebasing branch 
'\''amend_last'\'' on '\''dd030b9'\''.
#   (use "git commit --amend" to amend the current commit)
#   (use "git rebase --continue" once you are satisfied with your 
changes)
#
@@ -269,7 +269,7 @@ test_expect_success 'status: (continue first edit) second 
edit' '
git rebase --continue &&
cat >expected <<-\EOF &&
# Not currently on any branch.
-   # You are currently editing a commit during a rebase.
+   # You are currently editing a commit while rebasing branch 
'\''several_edits'\'' on '\''eb16a7e'\''.
#   (use "git commit --amend" to amend the current commit)
#   (use "git rebase --continue" once you are satisfied with your 
changes)
#
@@ -290,7 +290,7 @@ test_expect_success 'status: (continue first edit) second 
edit and split' '
git reset HEAD^ &&
cat >expected <<-\EOF &&
# Not currently on any branch.
-   # You are currently splitting a commit during a rebase.
+   # You are currently splitting a commit while rebasing branch 
'\''several_edits'\'' on '\''eb16a7e'\''.
#   (Once your working directory is clean, run "git rebase --continue")
#
# Change