Re: [PATCH dim 2/2] dim: Curate and insert tags into patch(es)

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

 



On Thu, 23 Mar 2017, Sean Paul <seanpaul@xxxxxxxxxxxx> wrote:
> Launch $EDITOR when extracting tags to curate the tags immediately. Once the
> tags are proper, automatically add them before the first Signed-off-by line
> to all patches in the range.

Two problems I have with this. First, I like to edit the final commit
message, not an intermediate file. Second, I pipe messages to dim
extract-tags *from* my $EDITOR, so I'd rather not have it launch $EDITOR
again.

BR,
Jani.

>
> Signed-off-by: Sean Paul <seanpaul@xxxxxxxxxxxx>
> ---
>  dim | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/dim b/dim
> index 43ea794..6a5580a 100755
> --- a/dim
> +++ b/dim
> @@ -1145,6 +1145,12 @@ function rangeish()
>  	fi
>  }
>  
> +function insert_extracted_tags
> +{
> +	new_tabs=`cat $1 | awk '{ORS="\\\\n"} {print $0}' | head -c-3`
> +	awk "/Signed-off-by/{p++} p==1{print \"$new_tabs\"; p++} p!=1{print}"
> +}
> +
>  function dim_extract_tags
>  {
>  	local branch range file tags
> @@ -1167,9 +1173,10 @@ function dim_extract_tags
>  		return 0
>  	fi
>  
> -	tags=$(printf -- "# *** extracted tags ***\n%s" "$tags")
> -
> -	git filter-branch -f --msg-filter "cat ; echo \"$tags\"" $range
> +	echo "$tags" > $file
> +	$EDITOR $file
> +	export -f insert_extracted_tags
> +	git filter-branch -f --msg-filter "insert_extracted_tags $file" $range
>  }
>  
>  function dim_extract_queued

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux