I hacked 3 commands to explore the dependencies of TopGit patches:
I) tg prev [NAME]
outputs the dependencies of NAME
II) tg next [NAME]
outputs patches that depends on NAME
III) tg tsort [PATTERN]
outputs a topological order of all patches starting with PATTERN
I'm more than open for improvments.
Regards
Bert
Signed-off-by: Bert Wesarg <redacted>
---
.gitignore | 6 ++++++
tg-next.sh | 33 +++++++++++++++++++++++++++++++++
tg-prev.sh | 27 +++++++++++++++++++++++++++
tg-tsort.sh | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 123 insertions(+), 0 deletions(-)
From: Petr Baudis <hidden> Date: 2016-06-15 22:45:23
On Fri, Sep 19, 2008 at 11:55:01AM +0200, Bert Wesarg wrote:
To make this more similar to git format-patch, I added a 'From' and
a 'Date:' header and let 'tg patch' print to a file (which is shown as output).
Regards
Bert
Signed-off-by: Bert Wesarg <redacted>
I dislike the anyway completely bogus From line. If you want mbox
format, you should call (hypothetical) tg mail. Also, IMHO Date: should
be simply always printed at the end of the header, it's distracting if
it is higher.
Also, the writing to file is confusing to me. What are you trying to
achieve? If you want to export patches, why not use 'tg export' which
already has this functionality? To me, 'tg patch' is basically
equivalent of 'git show' for the whole branch.
--
Petr "Pasky" Baudis
The next generation of interesting software will be done
on the Macintosh, not the IBM PC. -- Bill Gates
On Mon, Sep 22, 2008 at 17:39, Petr Baudis [off-list ref] wrote:
On Fri, Sep 19, 2008 at 11:55:01AM +0200, Bert Wesarg wrote:
quoted
To make this more similar to git format-patch, I added a 'From' and
a 'Date:' header and let 'tg patch' print to a file (which is shown as output).
Regards
Bert
Signed-off-by: Bert Wesarg <redacted>
I dislike the anyway completely bogus From line. If you want mbox
format, you should call (hypothetical) tg mail. Also, IMHO Date: should
be simply always printed at the end of the header, it's distracting if
it is higher.
Also, the writing to file is confusing to me. What are you trying to
achieve? If you want to export patches, why not use 'tg export' which
already has this functionality? To me, 'tg patch' is basically
equivalent of 'git show' for the whole branch.
You're right. I'm not familiar what is needed as a header to be used
with git send-email.
But the additional indirection with tg export/git format-patch is
overkill for one patch.
Therefore I would leave the writing to file, but drop the additional
headers for me.
Bert
"and %q causes printf to output the corresponding argument in a
format that can be reused as shell input."
With /bin/sh == dash this doesn't work. I havn't looked where and how
this is used, but rev-parse has an --sq option that results in the
output being shell quoted. Maybe this can help?
Best regards
Uwe
"and %q causes printf to output the corresponding argument in a
format that can be reused as shell input."
With /bin/sh == dash this doesn't work. I havn't looked where and how
this is used, but rev-parse has an --sq option that results in the
output being shell quoted. Maybe this can help?
I'm unsure if this quoting is actually needed.
I build a map from revision (sha1) to topic name:
abc..\tt/topic
and use this file (after |sort|uniq) to build a sed script which
replaces sha1 with the topic name in the output from tsort:
s#abc...#t/topic#
Maybe the quoting is not needed.
Bert
From: Petr Baudis <hidden> Date: 2016-06-15 22:45:24
On Mon, Sep 22, 2008 at 07:32:50PM +0200, Bert Wesarg wrote:
On Mon, Sep 22, 2008 at 17:36, Petr Baudis [off-list ref] wrote:
quoted
Hi,
On Fri, Sep 19, 2008 at 11:55:00AM +0200, Bert Wesarg wrote:
quoted
I hacked 3 commands to explore the dependencies of TopGit patches:
thanks, the idea of all three commands is good,
quoted
I) tg prev [NAME]
outputs the dependencies of NAME
II) tg next [NAME]
outputs patches that depends on NAME
but I think it would be cleaner to add this functionality to
tg info...
Right, but 'tg next' is shorter than any 'tg info --next'.
So, an alias? ;-) I wouldn't really like to clutter the UI with many
trivial commands for getting various sort of info. And I mean, ideally
you could just see all this in default 'tg info' output (or for
computationally expensive operations, maybe 'tg info -l'?).
quoted
quoted
III) tg tsort [PATTERN]
outputs a topological order of all patches starting with PATTERN
...and tg summary (overally, to have a tree view of branches).
Maybe something like the graph output from git rev-log --graph?
"and %q causes printf to output the corresponding argument in a
format that can be reused as shell input."
I thought that this would be needed.
Interesting, I didn't find that in my documentation. But as said later,
this quoting is probably unnecessary.
--
Petr "Pasky" Baudis
People who take cold baths never have rheumatism,
but they have cold baths.
To make this more similar to git format-patch, I added a 'From' and
a 'Date:' header and let 'tg patch' print to a file (which is shown as output).
Regards
Bert
Signed-off-by: Bert Wesarg <redacted>
---
tg-patch.sh | 25 ++++++++++++++++++++++++-
1 files changed, 24 insertions(+), 1 deletions(-)
@@ -42,5 +61,9 @@ rm "$git_is_stupid"echo'-- 'echo"tg: ($base_rev..) $name (depends on: $(gitcat-fileblob"$name:.topdeps"|paste-s-d' '))"++exec1>&3+exec3>&-+ branch_contains"$name""$base_rev"||echo"tg: The patch is out-of-date wrt. the base! Run \`$tg update\`."
--
tg: (7ec3927..) t/patch (depends on: t/queue-movement)