git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* TOPGIT: [PATCH] tg create: add --force option to resolve merge dependencies.
@ 2008-08-12 13:01 Jan Nieuwenhuizen
  2008-08-12 13:38 ` Petr Baudis
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Nieuwenhuizen @ 2008-08-12 13:01 UTC (permalink / raw)
  To: git

I have been trying to adapt my ooo-build export to topgit
instead of plain git and ran into the (documented and
expected) merge conflicts in .top*.

After unsuccesfully trying to script around it in my
gob git-export script, I found that this simple tg-create.sh
seems to work for me: just remove any <<<,===,>>> from
.topdeps and simply generate the new .topmgs later.

What do you think?  Is this naive way of 'auto' resolving
dependency problems doing the right thing?

BTW: thanks for creating topgit, it looks like just what
     I was missing.

-- janneke

Signed-off-by: Jan Nieuwenhuizen <janneke@gnu.org>
---
 tg-create.sh |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/tg-create.sh b/tg-create.sh
index 6cce7ed..0c83460 100644
--- a/tg-create.sh
+++ b/tg-create.sh
@@ -14,6 +14,8 @@ name=
 while [ -n "$1" ]; do
 	arg="$1"; shift
 	case "$arg" in
+	--force)
+		force=1;;
 	-*)
 		echo "Usage: tg create NAME [DEPS...]" >&2
 		exit 1;;
@@ -82,6 +84,11 @@ while [ -n "$merge" ]; do
 	info "Merging $name base with $branch..."
 
 	if ! git merge "$branch"; then
+	    if test "$force" = "1"; then
+                mv .topdeps .topdeps~ && grep -Ev '(<|>|=){7}' .topdeps~ > .topdeps && rm .topdeps~
+                git add .topdeps .topmsg
+                git commit -am 'Auto-resolve topgit .top* merge failure.'
+	    else
 		info "Please commit merge resolution and call: tg create"
 		info "It is also safe to abort this operation using \`git reset --hard\`"
 		info "but please remember you are on the base branch now;"
@@ -89,6 +96,7 @@ while [ -n "$merge" ]; do
 		echo "$deps" >"$git_dir/top-deps"
 		echo "$merge" >"$git_dir/top-merge"
 		exit 2
+	    fi
 	fi
 done
 
-- 
1.6.0.rc0.44.g67270


-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: TOPGIT: [PATCH] tg create: add --force option to resolve merge dependencies.
  2008-08-12 13:01 TOPGIT: [PATCH] tg create: add --force option to resolve merge dependencies Jan Nieuwenhuizen
@ 2008-08-12 13:38 ` Petr Baudis
  2008-08-12 15:02   ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 4+ messages in thread
From: Petr Baudis @ 2008-08-12 13:38 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: git

  Hi,

On Tue, Aug 12, 2008 at 03:01:46PM +0200, Jan Nieuwenhuizen wrote:
> I have been trying to adapt my ooo-build export to topgit
> instead of plain git and ran into the (documented and
> expected) merge conflicts in .top*.
> 
> After unsuccesfully trying to script around it in my
> gob git-export script, I found that this simple tg-create.sh
> seems to work for me: just remove any <<<,===,>>> from
> .topdeps and simply generate the new .topmgs later.
> 
> What do you think?  Is this naive way of 'auto' resolving
> dependency problems doing the right thing?

  how exactly did you get the morge conflicts? These should never happen
- I don't think we document them either? Pre-0.2 TopGit with dash as
/bin/sh had a bug that caused the conflicts to still happen, but that
should've been fixed (check if your .git/info/attributes does not
contain '-e' at the line beginnings ;-).

-- 
				Petr "Pasky" Baudis
The next generation of interesting software will be done
on the Macintosh, not the IBM PC.  -- Bill Gates

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: TOPGIT: [PATCH] tg create: add --force option to resolve merge dependencies.
  2008-08-12 13:38 ` Petr Baudis
@ 2008-08-12 15:02   ` Jan Nieuwenhuizen
  2008-08-12 17:55     ` Bert Wesarg
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Nieuwenhuizen @ 2008-08-12 15:02 UTC (permalink / raw)
  To: Petr Baudis; +Cc: git

On di, 2008-08-12 at 15:38 +0200, Petr Baudis wrote:

>   how exactly did you get the morge conflicts?

I'm not sure, cannot seem to reproduce them anymore.  May
have been pre-0.2 issue or another goof-up over here.

Thanks.

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: TOPGIT: [PATCH] tg create: add --force option to resolve merge dependencies.
  2008-08-12 15:02   ` Jan Nieuwenhuizen
@ 2008-08-12 17:55     ` Bert Wesarg
  0 siblings, 0 replies; 4+ messages in thread
From: Bert Wesarg @ 2008-08-12 17:55 UTC (permalink / raw)
  To: Jan Nieuwenhuizen; +Cc: Petr Baudis, git

On Tue, Aug 12, 2008 at 17:02, Jan Nieuwenhuizen <janneke-list@xs4all.nl> wrote:
> On di, 2008-08-12 at 15:38 +0200, Petr Baudis wrote:
>
>>   how exactly did you get the morge conflicts?
>
> I'm not sure, cannot seem to reproduce them anymore.  May
> have been pre-0.2 issue or another goof-up over here.
Could be, there was a fix for this from me. If you have a
.git/info/gitattributes file, you where hit by the bug. But with 0.2
this is gone.

Bert
>
> Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-08-12 17:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-12 13:01 TOPGIT: [PATCH] tg create: add --force option to resolve merge dependencies Jan Nieuwenhuizen
2008-08-12 13:38 ` Petr Baudis
2008-08-12 15:02   ` Jan Nieuwenhuizen
2008-08-12 17:55     ` Bert Wesarg

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).