Package: git-debpush
Version: 13.2

While uploading src:dgit to expeerimental, I discovered that my git
remote was misconfigured.  So it made the tag, but then failed to
push.  This isn't a very nice failure mode, particularly because
fixing the config and retrying doesn't work because the tag has
already been made.

I suggest:

 * After doing all the local checks, but before making the tag, run
   git fetch on the selected remote.  (Not in --tag-only and
   --print-tag-text modes.)  We should probably do a ref-limited fetch
   covering the tag we are proposing to make, and 

 * Check that the local branch is ff from the remote.  (If it isn't
   then someone has pushed to salsa in the mesntime.  Probably, the
   user wants to know about this.)

 * If the remote branch is ff from the local one, do not attempt to
   push it.  This can happen if the user overrode the previous check,
   an is deliberately tagging an older commit.

   It also happens if the remote and local branches are the same.  Not
   pushing the branch in this case is good because it means that if
   the git-debpush user is racing with something on salsa, the push
   doesn't fail after making the tag.

   This might also help with a forge that prevents "git push" and only
   allows explicit MR merge operatiuons.  Gitlab has that option, but
   empirically it doesn't object if the push you're making won't
   actually update the remote ref.

 * Provide options which can be used to retry a push, including
   a way to push only the tag.  How about --retry-push
   and --no-branch (= `--branch=HEAD~0`).

For testing, we may want to invent a new test case that just tests
git-debpush corner cases but doesn't invoke the whole t2u machinery to
process the actual tag.  That would also help us in the future when
we'll want to update the server-side machinery to new dependencies but
still be able to test git-debpush on old releases.

Ian.

-- 
Ian Jackson <ijack...@chiark.greenend.org.uk>   These opinions are my own.  

Pronouns: they/he.  If I emailed you from @fyvzl.net or @evade.org.uk,
that is a private address which bypasses my fierce spamfilter.

Reply via email to