[PATCH] qf: Add more wiggle helpers.

Lucas De Marchi lucas.de.marchi at gmail.com
Thu Jan 25 00:00:55 UTC 2018


On Wed, Jan 24, 2018 at 03:00:50PM -0800, Rodrigo Vivi wrote:
> When working with wiggle to easily solve rebasing
> conflicts we also need to be able to easily continue,
> easily see the impacted files and easily clean the
> repo to avoid ending up with many .rej and .porig files.
> 
> Cc: Paulo Zanoni <paulo.r.zanoni at intel.com>
> Cc: Michel Thierry <michel.thierry at intel.com>
> Cc: James Ausmus <james.ausmus at intel.com>
> Cc: Lucas De Marchi <lucas.demarchi at intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> ---
>  qf | 32 ++++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
> 
> diff --git a/qf b/qf
> index b28ca70ddcfd..e4bb2e95e17d 100755
> --- a/qf
> +++ b/qf
> @@ -432,6 +432,38 @@ function qf_stage
>  	echo All applied patches successfully staged
>  }
>  
> +function qf_wiggle_clean

Is this really supposed to be a subcmd? I know we already have
qf_wiggle_push, but I think the fact we are using wiggle should just be
an implementation detail. Thoughts?

> +{
> +	cd_toplevel
> +	conflict_files=$(git status --porcelain | grep "\.rej" | cut -c4-)

we can use one less pipe:

git status --porcelain=2 '*.c' | cut --delimiter=' ' -f 2

> +	for file in $conflict_files ; do
> +		echo cleaning $file ${file%.rej}.porig
> +		rm -rf $file ${file%.rej}.porig

why -r?

> +	done
> +}
> +
> +function qf_conflict_files
> +{
> +	cd_toplevel
> +	conflict_files=$(git status --porcelain | grep "\.rej" | cut -c4-)
> +
> +	if [[ $conflict_files == "" ]] ; then

if [ -z "$conflict_files" ]

Lucas De Marchi


More information about the dim-tools mailing list