Re: [PATCH] dim: Don't escape forward slash for grep
On Wed, Feb 08, 2023 at 08:21:51AM -0500, Rodrigo Vivi wrote: > On Wed, Feb 08, 2023 at 03:32:43AM +0200, Ville Syrjala wrote: > > From: Ville Syrjälä > > > > GNU grep 3.8 started to complain about backslashes where > > they're not needed: > > grep: warning: stray \ before / > > Get rid of them. > > > > Signed-off-by: Ville Syrjälä > > --- > > dim | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/dim b/dim > > index b87b54259f8b..296feb9dd314 100755 > > --- a/dim > > +++ b/dim > > @@ -503,7 +503,7 @@ function dim_retip > > if repo_to_remote drm-tip &> /dev/null ; then > > new_upstream=$(repo_to_remote drm-tip)/drm-tip > > else > > - new_upstream=$(git branch -r | grep '\/drm-tip$') > > + new_upstream=$(git branch -r | grep '/drm-tip$') > > this I knew it would work... because of ' ' > > > fi > > upstream=$(git_find_tip "$branch") > > > > @@ -1124,12 +1124,12 @@ function check_diff_prefix > > local rv patch msg patch_recoded > > patch="$1" > > > > - rv=$(grep -q -E "^diff --git a\/.+ b\/.+$" $patch) > > + rv=$(grep -q -E "^diff --git a/.+ b/.+$" $patch) > > but here with " " > I had my doubts... but confirmed that it does work with previous > grep 3.7. > > I hope it doesn't go badly with older grep versions... > > with this hope > > Reviewed-by: Rodrigo Vivi I can't push this btw. -EPERM or something. > > > > if [ -z "$rv" ]; then > > msg=$(mktemp --tmpdir dim-msg.XX) > > patch_recoded=$(mktemp --tmpdir dim-patch.XX) > > git mailinfo "$msg" "$patch_recoded" < $patch >/dev/null > > - rv=$(grep -q -E "^diff --git a\/.+ b\/.+$" $patch_recoded) > > + rv=$(grep -q -E "^diff --git a/.+ b/.+$" $patch_recoded) > > rm "$msg" "$patch_recoded" > > fi > > > > -- > > 2.39.1 > > -- Ville Syrjälä Intel
Re: [PATCH] dim: shut up git add harder
On Wed, 29 Mar 2023 at 16:21, Rodrigo Vivi wrote: > > On Wed, Mar 29, 2023 at 03:42:43PM +0200, Daniel Vetter wrote: > > On Tue, 28 Mar 2023 at 20:11, Rodrigo Vivi wrote: > > > > > > On Tue, Mar 28, 2023 at 07:36:44PM +0200, Daniel Vetter wrote: > > > > Apparently my git (v2.40.0) does more warnings and we're not silencing > > > > all the possible ones in the commit_rerere_cache function > > > > > > > > Signed-off-by: Daniel Vetter > > > > --- > > > > dim | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > diff --git a/dim b/dim > > > > index b87b54259f8b..c630d7295568 100755 > > > > --- a/dim > > > > +++ b/dim > > > > @@ -667,7 +667,7 @@ function commit_rerere_cache > > > > git rm $file &> /dev/null || true > > > > fi > > > > done > > > > - find rr-cache/ -mtime -1 -type f -not -name "thisimage*" -print0 > > > > | xargs -0 git add > /dev/null || true > > > > + find rr-cache/ -mtime -1 -type f -not -name "thisimage*" -print0 > > > > | xargs -0 git add &> /dev/null || true > > > > > > nothing we should be concerned with since they are marked as errors? > > > > > > also no possible true error that we would be now masking off? > > > > We already have the || true to eat any errors, and all other lines > > with git add || true do eat both stdou and stderr (at least in this > > function). So really seems like just an oversight. > > oh, indeed. > So, let's move with this then: > > Reviewed-by: Rodrigo Vivi Thanks, pushed. > > > > -Daniel > > > > > > > > > git rm rr-cache/rr-cache &> /dev/null || true > > > > > > > > commit_message=$(mktemp) > > > > -- > > > > 2.40.0 > > > > > > > > > > > > -- > > Daniel Vetter > > Software Engineer, Intel Corporation > > http://blog.ffwll.ch -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Re: [PATCH] dim: shut up git add harder
On Wed, Mar 29, 2023 at 03:42:43PM +0200, Daniel Vetter wrote: > On Tue, 28 Mar 2023 at 20:11, Rodrigo Vivi wrote: > > > > On Tue, Mar 28, 2023 at 07:36:44PM +0200, Daniel Vetter wrote: > > > Apparently my git (v2.40.0) does more warnings and we're not silencing > > > all the possible ones in the commit_rerere_cache function > > > > > > Signed-off-by: Daniel Vetter > > > --- > > > dim | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/dim b/dim > > > index b87b54259f8b..c630d7295568 100755 > > > --- a/dim > > > +++ b/dim > > > @@ -667,7 +667,7 @@ function commit_rerere_cache > > > git rm $file &> /dev/null || true > > > fi > > > done > > > - find rr-cache/ -mtime -1 -type f -not -name "thisimage*" -print0 | > > > xargs -0 git add > /dev/null || true > > > + find rr-cache/ -mtime -1 -type f -not -name "thisimage*" -print0 | > > > xargs -0 git add &> /dev/null || true > > > > nothing we should be concerned with since they are marked as errors? > > > > also no possible true error that we would be now masking off? > > We already have the || true to eat any errors, and all other lines > with git add || true do eat both stdou and stderr (at least in this > function). So really seems like just an oversight. oh, indeed. So, let's move with this then: Reviewed-by: Rodrigo Vivi > -Daniel > > > > > > git rm rr-cache/rr-cache &> /dev/null || true > > > > > > commit_message=$(mktemp) > > > -- > > > 2.40.0 > > > > > > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch
Re: [PATCH] dim: shut up git add harder
On Tue, 28 Mar 2023 at 20:11, Rodrigo Vivi wrote: > > On Tue, Mar 28, 2023 at 07:36:44PM +0200, Daniel Vetter wrote: > > Apparently my git (v2.40.0) does more warnings and we're not silencing > > all the possible ones in the commit_rerere_cache function > > > > Signed-off-by: Daniel Vetter > > --- > > dim | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/dim b/dim > > index b87b54259f8b..c630d7295568 100755 > > --- a/dim > > +++ b/dim > > @@ -667,7 +667,7 @@ function commit_rerere_cache > > git rm $file &> /dev/null || true > > fi > > done > > - find rr-cache/ -mtime -1 -type f -not -name "thisimage*" -print0 | > > xargs -0 git add > /dev/null || true > > + find rr-cache/ -mtime -1 -type f -not -name "thisimage*" -print0 | > > xargs -0 git add &> /dev/null || true > > nothing we should be concerned with since they are marked as errors? > > also no possible true error that we would be now masking off? We already have the || true to eat any errors, and all other lines with git add || true do eat both stdou and stderr (at least in this function). So really seems like just an oversight. -Daniel > > > git rm rr-cache/rr-cache &> /dev/null || true > > > > commit_message=$(mktemp) > > -- > > 2.40.0 > > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch