Re: [PATCH v2] bash-prompt.sh: Show where rebase is at when interrupted by a merge conflict

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Zoltan Klinger <zoltan.klinger@xxxxxxxxx> writes:

> When a rebase is interrupted by a merge conflict it could be useful to

The command also stops when told to stop with "amend", etc. no?  I
would phrase this way "When a rebase stops (e.g. interrupted ...),
it could be useful...".

> This information can be already obtained from the following files which are
> being generated during the rebase:
>     GIT_DIR/.git/rebase-merge/msgnum (git-rebase--merge.sh)
>     GIT_DIR/.git/rebase-merge/end    (git-rebase--merge.sh)
>     GIT_DIR/.git/rebase-apply/next   (git-am.sh)
>     GIT_DIR/.git/rebase-apply/last   (git-am.sh)

Here, I would add:

	But "git rebase -i" did not leave enough clues.

> 1) Modify git-rebase--interactive.sh to also create
>       GIT_DIR/.git/rebase-merge/msgnum
>       GIT_DIR/.git/rebase-merge/end
>    files for the number of commits so far applied and the total number of
>    commits to be applied.
> 2) Modify git-prompt.sh to read and display info from the above files

Missing full-stop at the end.

> 3) Update test t9903-bash-prompt.sh to reflect changes introduced by
>    this patch.
>
> Signed-off-by: Zoltan Klinger <zoltan.klinger@xxxxxxxxx>
> ---

Thanks.

> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> index 048a140..f76ff8f 100644
> --- a/git-rebase--interactive.sh
> +++ b/git-rebase--interactive.sh
> @@ -57,6 +57,9 @@ rewritten="$state_dir"/rewritten
>  
>  dropped="$state_dir"/dropped
>  
> +end="$state_dir"/end
> +msgnum="$state_dir"/msgnum
> +
>  # A script to set the GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, and
>  # GIT_AUTHOR_DATE that will be used for the commit that is currently
>  # being rebased.
> @@ -109,7 +112,9 @@ mark_action_done () {
>  	sed -e 1d < "$todo" >> "$todo".new
>  	mv -f "$todo".new "$todo"
>  	new_count=$(git stripspace --strip-comments <"$done" | wc -l)
> +	echo $new_count > $msgnum
>  	total=$(($new_count + $(git stripspace --strip-comments <"$todo" | wc -l)))
> +	echo $total > $end

Write them like this:

	echo foo >"$variable"

Having no SP between redirection operator and redirection target is
merely a style thing [*1*].  Having an unnecessary dq around a
variable name that is used as redirection target is to work around a
bug in certain versions of bash that issues useless warnings.

I'll locally squeeze the above suggestions in and queue the result.
Please check what will appear on 'pu' by the end of day.

Thanks.


[Footnote]

*1* But a style request is not optional ;-)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]