On Thu, May 29, 2008 at 18:16, Andrew Morton <[EMAIL PROTECTED]> wrote:
> On Fri, 30 May 2008 02:55:02 +0200
> Nick Piggin <[EMAIL PROTECTED]> wrote:
>
>> Gah, missing quilt refresh. Sorry.
>
> Gee that happens a lot.
>
> Is there some way in which quilt can detect this?  Warn people that
> they're about to send a not-up-to-date diff?

I have a wrapper around quilt to integrate it with Perforce. I too
found myself frequently making that mistake when pushing a patch to
Perforce. So I added "quilt diff -z" to that function and check whether
the output is null.

  local delta=$(quilt diff -z 2>/dev/null | head -1)
  if [[ $delta != '' ]]; then # uncommitted changes exist
    q4_warn "Current patch has not been refreshed since making changes"
    read -p "Do you want to refresh the patch with the pending changes? [Y/n] "
    if [[ $REPLY = "" || $REPLY = y*  || $REPLY = Y* ]] ; then
      q4_refresh
    else
      q4_warn "Discarding recent changes to patch $top_patch"
      quilt pop -f
      quilt push
      q4_save_perms
    fi
  fi

-- 
Kurtis Rader
Caretaker of the exceptional canines Einstein and Haley
http://big.corp.google.com/~krader/notes/
+1 650-214-4244


_______________________________________________
Quilt-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/quilt-dev

Reply via email to