#535074 topgit: have patch export full history

#535074#5
Date:
2009-06-29 12:55:33 UTC
From:
To:
Package: topgit
Version: 0.7-1
Severity: minor

Hi,
I'm maintaining some patches with topgit as it is quite convenient for
debian packaging.
However when sending them upstream it would be nice to be able to send
the full history as git format-patch would do but excluding .topdeps and
.topmsg (or using it as basis for --cover-letter), IOW have tg patch
accept an option to behave like format-patch but output the full history

thanks,
filippo

#535074#10
Date:
2009-06-30 07:36:20 UTC
From:
To:
Hello Filippo,
nice to hear :-)
I don't understand what exactly you want.  Incremental patches?  I think
this won't work in general because the history typically contains merges
that are not representable by a patch.  Hm, you could leave out the
merges.  But then they might not apply cleanly to upstream's tree.

Do you really consider the intermediate steps interesting?  IMHO a topic
branch is a unit and if it's sensible to send in in (say) three mails
then the patch should better be seperated into three patches/topic
branches.

Maybe you could present an example where you can show that having the
full history is sensible?

Best regards
Uwe

#535074#15
Date:
2009-06-30 07:36:20 UTC
From:
To:
Hello Filippo,
nice to hear :-)
I don't understand what exactly you want.  Incremental patches?  I think
this won't work in general because the history typically contains merges
that are not representable by a patch.  Hm, you could leave out the
merges.  But then they might not apply cleanly to upstream's tree.

Do you really consider the intermediate steps interesting?  IMHO a topic
branch is a unit and if it's sensible to send in in (say) three mails
then the patch should better be seperated into three patches/topic
branches.

Maybe you could present an example where you can show that having the
full history is sensible?

Best regards
Uwe

#535074#20
Date:
2009-06-30 13:22:04 UTC
From:
To:
In general you are right, merges could be a problem

disclaimer: note that I might be missing something as I'm using topgit since
some weeks and topgit might not the best tool for the scenario below

My scenario is that I'm maintaining a topic branch against upstream which also
uses git, for the sake of consistency I'm using topgit as that branch will
probably go in debian/patches/

If I want to send the branch upstream for review I would like incremental
patches as that is nicer on upstream, OTOH for debian packaging I'm exporting as
a single patch.
So far so good, the problem is that sending upstream incremental patches from
topgit as you would normally do with git format-patch you have to exclude
.topmsg and .topdeps which tg patch already does

I fear that having a branch per topic is generally okay but not if you want
clean history including micro commits to be send upstream.

filippo

#535074#25
Date:
2009-06-30 18:31:34 UTC
From:
To:
Hello Filippo,
Obviously you don't want to feed your complete patch upstream as is, OK.
But in general you want to squash more the one commit to get a nice
patch.  Your approach only works if you did your patch right right from
the beginning.  (Note: you could simply use git-format-patch for that.)
I assume you don't mean with incremental that you only send the new
changes if you send an updated patch, do you?
Try this:

Collect your patches in a single topic branch as you do now.  I'll call
it t/debian-sid-pu.  If you want to send something upstream do the
following (assuming your upstream branch is called "upstream"):

	$ tg create t/nice-name-for-topic upstream
	$ vim .topmsg; vim $file; git add .topmsg $file; git commit

expecting that you duplicate a part of t/debian-sid-pu in
t/nice-name-for-topic.  If you want you can also cherry pick from
top-bases/t/debian-sid-pu..t/debian-sid-pu.  Then

	$ git checkout t/debian-sid-pu
	$ tg depend add t/nice-name-for-topic

If your changes in t/debian-sid-pu are seperated enough, the last
command should just merge t/nice-name-for-topic into t/debian-sid-pu
without changing the tree of t/debian-sid-pu.  (Otherwise you get a
merge conflict that you probably want to resolve such that again the
tree of t/debian-sid-pu doesn't change.)

With this workflow you can create your topic branches on demand after
the changes are already used.  Still it allows to group more than one
commit into a topic.

If I didn't understood you right (or you didn't understood me) I suggest
you join

	irc://chat.freenode.net/#topgit

I'm usually around there when I'm online and a few others, too.

Best regards
Uwe

#535074#30
Date:
2009-07-02 09:49:50 UTC
From:
To:
exactly

Not necessarily, if I know the branch is for upstream consumption I can rework
the history to be clean.

Anyhow, and that's the whole point, I can't use git format-patch on a topgit
branch unless I remember to manually exclude .topgit and .topdeps, otherwise
upstream will get those as well.

correct

[omitting the rest, but thanks for the suggestion]

filippo

#535074#35
Date:
2010-04-10 13:47:07 UTC
From:
To:
Hello Filippo,
What do you think on this bug today?  I consider it OK to close it as
"invalid" or somthing like that.

Best regards
Uwe

#535074#40
Date:
2010-04-10 13:53:10 UTC
From:
To:
Hi Uwe,

I tend to agree, yes, if one wants to use format-patch then it is easy to
alias it to something and exclude .topgit and .topdeps, please go ahead

thanks,
filippo