From: Jani Nikula <jani.nikula@linux.intel.com>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH 1/2] dim: Stop force-pushing tags
Date: Tue, 21 Mar 2017 16:12:16 +0200 [thread overview]
Message-ID: <87var2afcv.fsf@intel.com> (raw)
In-Reply-To: <20170321125824.14641-1-daniel.vetter@ffwll.ch>
On Tue, 21 Mar 2017, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> It's evil. And if you've catastrophically screwed up a pull request
> it's probably better to be forced to wait 1 day.
Not true anymore. ;)
>
> v2: Autogenerate a new tag with increasing suffice, to make Jani
> happy.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
> dim | 36 ++++++++++++++++++++++++++----------
> 1 file changed, 26 insertions(+), 10 deletions(-)
>
> diff --git a/dim b/dim
> index c4fb047deda2..e0c1909653b6 100755
> --- a/dim
> +++ b/dim
> @@ -1329,7 +1329,7 @@ function dim_update_next
>
> function dim_update_next_continue
> {
> - local remote
> + local remote suffix
>
> assert_branch drm-intel-next-queued
>
> @@ -1337,13 +1337,18 @@ function dim_update_next_continue
>
> git push $DRY_RUN -f $DIM_DRM_INTEL_REMOTE drm-intel-next-queued:drm-intel-next
> tag=drm-intel-next-$today
> - $DRY git tag -f -a $tag $DIM_DRM_INTEL_REMOTE/drm-intel-next
> - git push $DRY_RUN -f $DIM_DRM_INTEL_REMOTE $tag
> +
> + while git tag -l $tag | grep -q $tag ; do
> + tag="drm-intel-next-$today-$((++suffix))"
> + done
> +
> + $DRY git tag -a $tag $DIM_DRM_INTEL_REMOTE/drm-intel-next
> + git push $DRY_RUN $DIM_DRM_INTEL_REMOTE $tag
>
> echo "Updating drm-intel-testing to latest drm-tip"
> git push $DRY_RUN $DIM_DRM_INTEL_REMOTE +$remote/drm-tip:drm-intel-testing
> - $DRY git tag -f drm-intel-testing-$today $DIM_DRM_INTEL_REMOTE/drm-intel-testing
> - $DRY git push -f $DIM_DRM_INTEL_REMOTE drm-intel-testing-$today
> + $DRY git tag drm-intel-testing-$today $DIM_DRM_INTEL_REMOTE/drm-intel-testing
> + $DRY git push $DIM_DRM_INTEL_REMOTE drm-intel-testing-$today
So this would still fail? Dunno, maybe this could use -f.
Otherwise, LGTM.
>
> cat > ~/tmp/test-request <<-HERE
> Hi all,
> @@ -1372,6 +1377,8 @@ function dim_update_next_continue
>
> function dim_tag_next
> {
> + local tag suffix
> +
> cd $DIM_PREFIX/$DIM_DRM_INTEL
> git fetch $DIM_DRM_INTEL_REMOTE
>
> @@ -1379,8 +1386,12 @@ function dim_tag_next
> echo "Tagging current drm-intel-next"
>
> tag=drm-intel-next-$today
> - $DRY git tag -f $tag $DIM_DRM_INTEL_REMOTE/drm-intel-next
> - git push $DRY_RUN -f $DIM_DRM_INTEL_REMOTE $tag
> + while git tag -l $tag | grep -q $tag ; do
> + tag="drm-intel-next-$today-$((++suffix))"
> + done
> +
> + $DRY git tag $tag $DIM_DRM_INTEL_REMOTE/drm-intel-next
> + git push $DRY_RUN $DIM_DRM_INTEL_REMOTE $tag
> else
> echo "drm-intel-next not up-to-date, aborting"
> exit
> @@ -1391,7 +1402,7 @@ function dim_tag_next
> # dim_pull_request branch upstream
> function dim_pull_request
> {
> - local branch upstream remote repo url git_url
> + local branch upstream remote repo url git_url suffix tag
>
> if [[ "x$1" = "x" || "x$2" = "x" ]]; then
> echo "usage: $dim $subcommand branch upstream"
> @@ -1420,9 +1431,14 @@ function dim_pull_request
> repo="drm-intel"
> else
> tag=$branch-$today
> +
> + while git tag -l $tag | grep -q $tag ; do
> + tag="$branch-$today-$((++suffix))"
> + done
> +
> gitk "$branch@{upstream}" ^$upstream &
> - $DRY git tag -f -a $tag "$branch@{upstream}"
> - $DRY git push -f $remote $tag
> + $DRY git tag -a $tag "$branch@{upstream}"
> + $DRY git push $remote $tag
> prep_pull_mail $tag
>
> repo=$(branch_to_repo $branch)
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2017-03-21 14:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-21 9:08 [PATCH 1/2] dim: Run gitk before tagging Daniel Vetter
2017-03-21 9:08 ` [PATCH 2/2] dim: Stop force-pushing tags Daniel Vetter
2017-03-21 11:44 ` Jani Nikula
2017-03-21 12:58 ` [PATCH 1/2] " Daniel Vetter
2017-03-21 12:58 ` [PATCH 2/2] dim: really make the branch argument for dim retip optional Daniel Vetter
2017-03-21 14:13 ` Jani Nikula
2017-03-21 15:27 ` Daniel Vetter
2017-03-22 8:42 ` Jani Nikula
2017-03-21 14:12 ` Jani Nikula [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87var2afcv.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel.vetter@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).