git/list[1] front-page[2] threads[3] people[4] search[5] about
 

stgit "push --merged" woes

From
Yann Dirson <ydirson@altern.org>
Date
Feb 28, 2007, 22:15 UTC
Message-ID
<20070228221552.GL4045@nan92-1-81-57-214-146.fbx.proxad.net>
In-Reply-To
<b0943d9e0702211458o6de55e3fgd15dd4f4c1c2c622@mail.gmail.com>
On Wed, Feb 21, 2007 at 10:58:13PM +0000, Catalin Marinas wrote:
Show 13 quoted lines
> >Oh, while I'm at it, "push -m" does not seem to work as expected.
> >After pulling from your tree, which contains my changes, and rebasing
> >to your head, "push -m" of the "Factorize..." patch results in a
> >conflict, while rebasing onto this particular commit and then pushing
> >my original patch gets the merge properly detected.  Sounds like a
> >candidate for a quick 0.12.2 if we cannot kill it before 0.12.1.
> 
> Unless you deleted the empty patch, you could do a push --undo and try
> to reverse apply the diff (that's what push -m does) and see whether
> it fails or not. There might be a bug in StGIT and not be able to cope
> with new files while doing the merge check (this patch has a new test
> script). If I have time tomorrow, I'll try to put this in the push
> test-case.

Just had a similar case, trying to "push -m" my Documentation patches. The patch creating Documentation/ fails with conflict on Makefile.

Trying to reverse-apply the diff does not work, since the Makefile has been modified by another commit. I verified that reverse-applying the 2 patches touching that file in my stack does work.

That seems to imply that added files are not the only ones causing problems to the current "push -m". They just exhibit the problem more often.

"push -m" should probably try other techniques if that one fails. Reverse-apply on top of every newly-pulled commit that touches the problematic files would be a possibility, but that's expensive. Trying a meta-diff[1] between the patch to be pushed and candidate newly-pulled commits could be cheaper.

But both techniques would miss a case that current "push -m" seems to handle: when a patch was applied and then reversed upstream.

[1] FWIW, my (naive) stg-mdiff script:

==================== #!/bin/bash set -e

# stg-mdiff - display meta-diffs, ie. diffs of diffs

# Main use: show evolutions of a patch. # eg. stg-mdiff foo@stable foo # stg-mdiff foo 012345567ABCD # sha1 for "foo" as integrated upstream

# Copyright (c) 2007 Yann Dirson <ydirson@altern.org> # Subject to the GNU GPL, version 2.

usage()
{
    echo "Usage: $(basename $0) <patch1> <patch2>"
    exit 1
}
if [ "$#" != 2 ]; then
    usage
fi

colordiff -u <(stg show "$1") <(stg show "$2") | less -RFX ====================

Previous: Yann Dirson
Message 7 of 7 in “stgit rebasing fixes”
  1. 0/5 stgit rebasing fixesYann Dirson, Feb 20, 2007
  2. 1/5 Factorize rebasing behaviour.Yann Dirson, Feb 20, 2007
  3. 2/5 Move stack-base querying into Series class.Yann Dirson, Feb 20, 2007
  4. 3/5 Various cleanups for clarity.Yann Dirson, Feb 20, 2007
  5. 4/5 Keep track of safe base changes.Yann Dirson, Feb 20, 2007
  6. 5/5 Refuse to pull/rebase when rendered unsafe by (un)commits.Yann Dirson, Feb 20, 2007
  7. stgit "push --merged" woesYann Dirson, Feb 28, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.