{"thread":{"id":"6289","subject":"[PATCH] Add contrib/stg-gitk: helper script to run gitk","startedAt":"2007-01-08T22:12:26Z","lastAt":"2007-01-12T23:09:22Z","messageCount":9,"participants":["Yann Dirson","Catalin Marinas","Baz"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"31166","messageId":"20070108220918.18329.30083.stgit@gandelf.nowhere.earth","threadId":"6289","inReplyTo":null,"subject":"[PATCH] Add contrib/stg-gitk: helper script to run gitk","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2007-01-08T22:12:26Z","receivedAt":"2007-01-08T22:12:26Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"\n\n\nSigned-off-by: Yann Dirson <ydirson@altern.org>\n---\n\nHere is a small helper script implementing the display of current/named/all\nstgit stacks (or standard branches) in gitk.  As noted earlier, that does not\nallow to see new refs by requesting an update from gitk, but it will still be\nuseful to me at least :)\n\n contrib/stg-gitk |   59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 59 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/stg-gitk b/contrib/stg-gitk\nnew file mode 100755\nindex 0000000..8d4ae43\n--- /dev/null\n+++ b/contrib/stg-gitk\n@@ -0,0 +1,59 @@\n+#!/bin/sh\n+set -e\n+\n+# stg-gitk - helper script to graphically display an StGIT stack\n+\n+# Allows quick synchronization of a cvs mirror branch (does not try to\n+# reconstruct patchsets, creates \"jumbo\" commits), and commits stgit\n+# patches to CVS.\n+\n+# LIMITATIONS:\n+# - asking gitk to \"update\" won't detect any new ref\n+# - no support for spaces in branch names\n+\n+# Copyright (c) 2007 Yann Dirson <ydirson@altern.org>\n+# Subject to the GNU GPL, version 2.\n+\n+usage()\n+{\n+    echo \"Usage: $(basename $0) [<branches>|--all]\"\n+    exit 1\n+}\n+\n+allbranches=0\n+case \"$1\" in\n+--all) allbranches=1; shift ;;\n+--*) usage ;;\n+*) break ;;\n+esac\n+\n+if [ $allbranches = 1 ] && [ \"$#\" -gt 0 ]; then\n+    usage\n+fi\n+\n+GIT_DIR=$(git-rev-parse --git-dir)\n+GIT_DIR_SPKIPLEN=$(printf \"$GIT_DIR/X\" | wc -c)\n+\n+refdirs=''\n+if [ $allbranches = 1 ]; then\n+    refdirs=\"$GIT_DIR/refs\"\n+else\n+    if [ \"$#\" = 0 ]; then\n+\tset -- \"$(stg branch)\"\n+    fi\n+\n+    for b in \"$@\"; do\n+\tif [ -e \"$GIT_DIR/refs/patches/$b\" ]; then\n+\t    # StGIT branch: show all patches\n+\t    refdirs=\"$refdirs $GIT_DIR/refs/patches/$b\"\n+\telif [ -e \"$GIT_DIR/refs/heads/$b\" ]; then\n+\t    # other GIT branch\n+\t    refdirs=\"$refdirs $GIT_DIR/refs/heads/$b\"\n+\telse\n+\t    echo >&2 \"ERROR: no such branch '$b'\"\n+\t    usage\n+\tfi\n+    done\n+fi\n+\n+gitk $(find $refdirs -type f -not -name '*.log' | cut -c${GIT_DIR_SPKIPLEN}- )\n"},{"id":"31219","messageId":"b0943d9e0701090202v7951076cg7c86c0f5499c7d60@mail.gmail.com","threadId":"6289","inReplyTo":"20070108220918.18329.30083.stgit@gandelf.nowhere.earth","subject":"Re: [PATCH] Add contrib/stg-gitk: helper script to run gitk","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-01-09T10:02:06Z","receivedAt":"2007-01-09T10:02:06Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 08/01/07, Yann Dirson <ydirson@altern.org> wrote:\n> Here is a small helper script implementing the display of current/named/all\n> stgit stacks (or standard branches) in gitk.  As noted earlier, that does not\n> allow to see new refs by requesting an update from gitk, but it will still be\n> useful to me at least :)\n\nThere is 'stg series --graphical' that invokes gitk. Maybe the 'show'\ncommand could have a similar option.\n\nI'm a bit reluctant to these patches. I really don't like mixing\ndifferent languages (python and shell script) in the StGIT command\nimplementations. I agree with some scripts like bash completion and\neven a diff-colouring pager but not commands used on a daily basis by\nsome people (even if only in the contrib directory).\n\nSome of the patches you posted can be implemented in Python as either\nnew commands or extensions to the current ones (I'll follow up to your\nother e-mails).\n\nBTW, I'm happy to create a 'scripts' section on wiki.procode.org where\nto add them.\n\n-- \nCatalin\n"},{"id":"31295","messageId":"20070109220332.GD17093@nan92-1-81-57-214-146.fbx.proxad.net","threadId":"6289","inReplyTo":"b0943d9e0701090202v7951076cg7c86c0f5499c7d60@mail.gmail.com","subject":"Re: [PATCH] Add contrib/stg-gitk: helper script to run gitk","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2007-01-09T22:03:32Z","receivedAt":"2007-01-09T22:03:32Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"On Tue, Jan 09, 2007 at 10:02:06AM +0000, Catalin Marinas wrote:\n> There is 'stg series --graphical' that invokes gitk.\n\nFor some reason I did not look for this functionality in that place :)\n\nBut it is a bit different, in that unapplied patches appear detached\nfrom the whole history.  Possibly out of personal taste, I do not find\nthis very useful, and prefer to see them as \"gitk --all\" shows them.\n\n> Maybe the 'show' command could have a similar option.\n\nHm, not sure.  \"show\" is about a patch, not a stack.\n\n\n(let's go off-topic)\n\nThat makes me think that such command names like \"show\" are a bit too\ngeneral: stgit uses \"show\" for patches, but nothing says it is for a\npatch and not a series.\n\nAlso, when presenting GIT/StGIT to co-workers, I found them to be\nconfused by eg. \"stg push\" and \"stg commit\" having different semantics\nthan \"git push\" and \"git commit\".\n\nFinally, we have some \"stgit commands\" (eg. branch), which are not\nonly real commands, but also give access to sub-commands.\n\n\nMaybe some restucturing of commands is called for.  One possibility\nwould be to go with prefixes (eg. ppush, pshow), but that does not\naddress the sub-commands issue, which would have to be dealt with\nanother way, possibly by multiplying commands (branch -> blist,\nbcreate, etc), which I'm not very fond of.\n\nAnother would be to generalize command groups, and acknowledge\nsubcommands as such.  Eg:\n\nstg branch --create\t\t-> stg branch create\nstg show\t\t\t-> stg patch show\nstg push\t\t\t-> stg patch push\n\n\nThe latter obviously suggests that some would want to keep \"stg push\"\nas an alias (here comes again the idea of programable aliases like we\nalready have for GIT.\n\n\n> I'm a bit reluctant to these patches. I really don't like mixing\n> different languages (python and shell script) in the StGIT command\n> implementations.\n\nI concur.  This is why I submitted them as contrib/ stuff.\n\n> Some of the patches you posted can be implemented in Python as either\n> new commands or extensions to the current ones (I'll follow up to your\n> other e-mails).\n\nRight - indeed they can be seen as prototypes for future clean\nfeatures.  I'm simply not used enough to python, and it was quicker\nfor me to get those prototypes in shape this way.\n\nBest regards,\n-- \nYann.\n"},{"id":"31380","messageId":"2faad3050701100234g1580d344lcc84b143ee965a23@mail.gmail.com","threadId":"6289","inReplyTo":"20070109220332.GD17093@nan92-1-81-57-214-146.fbx.proxad.net","subject":"Re: [PATCH] Add contrib/stg-gitk: helper script to run gitk","fromName":"Baz","fromEmail":"brian.ewins@gmail.com","sentAt":"2007-01-10T10:34:53Z","receivedAt":"2007-01-10T10:34:53Z","isPatch":true,"sender":{"key":"brian.ewins@gmail.com","avatar":"https://gravatar.com/avatar/9ac03d89105e50a7151e695a1b4b1228151064ec3ac380a73b74ab397796baf7?d=mp&s=160"},"body":"On 09/01/07, Yann Dirson <ydirson@altern.org> wrote:\n> (let's go off-topic)\n>\n> That makes me think that such command names like \"show\" are a bit too\n> general: stgit uses \"show\" for patches, but nothing says it is for a\n> patch and not a series.\n>\n> Also, when presenting GIT/StGIT to co-workers, I found them to be\n> confused by eg. \"stg push\" and \"stg commit\" having different semantics\n> than \"git push\" and \"git commit\".\n\nThey're also confusing because the stg docs and other stg commands\nconsistently talk about patches being 'applied' or 'unapplied', not\n'pushed'. If stg push/pop were to make sense as single commands they\nwould be eg stg apply/unapply, or stg patch-apply, stg patch-unapply.\n\nCheers,\nBaz\n"},{"id":"31409","messageId":"20070110195212.GH17093@nan92-1-81-57-214-146.fbx.proxad.net","threadId":"6289","inReplyTo":"20070109220332.GD17093@nan92-1-81-57-214-146.fbx.proxad.net","subject":"Re: suggestions about stgit commands renaming","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2007-01-10T19:52:12Z","receivedAt":"2007-01-10T19:52:12Z","isPatch":false,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"On Tue, Jan 09, 2007 at 11:03:32PM +0100, Yann Dirson wrote:\n> Maybe some restucturing of commands is called for.  One possibility\n> would be to go with prefixes (eg. ppush, pshow), but that does not\n> address the sub-commands issue, which would have to be dealt with\n> another way, possibly by multiplying commands (branch -> blist,\n> bcreate, etc), which I'm not very fond of.\n> \n> Another would be to generalize command groups, and acknowledge\n> subcommands as such.  Eg:\n> \n> stg branch --create\t\t-> stg branch create\n> stg show\t\t\t-> stg patch show\n> stg push\t\t\t-> stg patch push\n> \n> \n> The latter obviously suggests that some would want to keep \"stg push\"\n> as an alias (here comes again the idea of programable aliases like we\n> already have for GIT.\n\nThinking twice, the current \"shortcut prefix\" mechanism would already\nallow us to use shortcuts like \"stg p show\" and \"stg b create\".\n"},{"id":"31421","messageId":"b0943d9e0701101535q68505b7cpf63b7bbe44620f53@mail.gmail.com","threadId":"6289","inReplyTo":"20070110195212.GH17093@nan92-1-81-57-214-146.fbx.proxad.net","subject":"Re: suggestions about stgit commands renaming","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-01-10T23:35:10Z","receivedAt":"2007-01-10T23:35:10Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 10/01/07, Yann Dirson <ydirson@altern.org> wrote:\n> Thinking twice, the current \"shortcut prefix\" mechanism would already\n> allow us to use shortcuts like \"stg p show\" and \"stg b create\".\n\n(I'm a bit busy for the next week or so and I won't be that responsive)\n\nThe initial command StGIT set was meant to be close to the Quilt's one\nso that it offers an easy transition. Some commands like 'import' or\n'branch' got more complex and I don't have anything against using\nsubcommands with them. The help tries to categorize the commands\nsomehow.\n\nHowever, I would still like the main commands (push/pop, series,\napplied/unapplied etc.) to remain as primary commands and be similar\nto Quilt. It would become impractical to type 'stg patch push' for\nexample, even if you have abbreviations.\n\nThere are tools with a much more unintuitive command/key set and\npeople still use them successfully (thinking of emacs).\n\n-- \nCatalin\n"},{"id":"31422","messageId":"b0943d9e0701101547v5e18bdf8xcc34cf78ea5f1f9f@mail.gmail.com","threadId":"6289","inReplyTo":"20070109220332.GD17093@nan92-1-81-57-214-146.fbx.proxad.net","subject":"Re: [PATCH] Add contrib/stg-gitk: helper script to run gitk","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-01-10T23:47:33Z","receivedAt":"2007-01-10T23:47:33Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 09/01/07, Yann Dirson <ydirson@altern.org> wrote:\n> On Tue, Jan 09, 2007 at 10:02:06AM +0000, Catalin Marinas wrote:\n> > There is 'stg series --graphical' that invokes gitk.\n>\n> For some reason I did not look for this functionality in that place :)\n>\n> But it is a bit different, in that unapplied patches appear detached\n> from the whole history.  Possibly out of personal taste, I do not find\n> this very useful, and prefer to see them as \"gitk --all\" shows them.\n\nI've never tried 'gitk --all' but I'm OK with changing the way\n--graphical option displays the patches.\n\n> > Maybe the 'show' command could have a similar option.\n>\n> Hm, not sure.  \"show\" is about a patch, not a stack.\n\n'show' can also display a range of patches.\n\n> That makes me think that such command names like \"show\" are a bit too\n> general: stgit uses \"show\" for patches, but nothing says it is for a\n> patch and not a series.\n\nThis was initially a re-implementation of 'git show' that was able to\nunderstand patch names (you can also give any commit id as argument).\nI later extended it to accept patch ranges.\n\n> Also, when presenting GIT/StGIT to co-workers, I found them to be\n> confused by eg. \"stg push\" and \"stg commit\" having different semantics\n> than \"git push\" and \"git commit\".\n\nAs I said in a different e-mail, push/pop were the command names used\nby quilt. I agree that they are confusing. Maybe we could change\ncommit/uncommit to store/unstore or something else (but I would like\nto keep push/pop).\n\nI don't like the idea of command aliases that much, it looks like\nunneeded complexity. You can use the bash aliases if you want (i.e.\n'alias stg-ppush=\"stg push\"').\n\n-- \nCatalin\n"},{"id":"31603","messageId":"20070112224733.GA9761@nan92-1-81-57-214-146.fbx.proxad.net","threadId":"6289","inReplyTo":"b0943d9e0701101547v5e18bdf8xcc34cf78ea5f1f9f@mail.gmail.com","subject":"Re: [PATCH] Add contrib/stg-gitk: helper script to run gitk","fromName":"Yann Dirson","fromEmail":"ydirson@altern.org","sentAt":"2007-01-12T22:47:33Z","receivedAt":"2007-01-12T22:47:33Z","isPatch":true,"sender":{"key":"ydirson@altern.org","avatar":"https://avatars.githubusercontent.com/u/1190950?v=4"},"body":"On Wed, Jan 10, 2007 at 11:47:33PM +0000, Catalin Marinas wrote:\n> On 09/01/07, Yann Dirson <ydirson@altern.org> wrote:\n> >On Tue, Jan 09, 2007 at 10:02:06AM +0000, Catalin Marinas wrote:\n> >> There is 'stg series --graphical' that invokes gitk.\n> >\n> >For some reason I did not look for this functionality in that place :)\n> >\n> >But it is a bit different, in that unapplied patches appear detached\n> >from the whole history.  Possibly out of personal taste, I do not find\n> >this very useful, and prefer to see them as \"gitk --all\" shows them.\n> \n> I've never tried 'gitk --all' but I'm OK with changing the way\n> --graphical option displays the patches.\n\nIndeed \"stg series -g\" may differ too much from \"stg-gitk\" to plug the\nfunctionnality at this place: \"stg series\" is a command acting on one\nstack, whereas stg-gitk is a repository-wide command, allowing to draw\nseveral stacks, and also includes anything below stack base, which\nlooks also out of the scope of \"stg series -g\".  Maybe a new command\nis called for - possibly as something like\n\"stg repo graph [<branch>...]\" ?\n\n\n> >That makes me think that such command names like \"show\" are a bit too\n> >general: stgit uses \"show\" for patches, but nothing says it is for a\n> >patch and not a series.\n> \n> This was initially a re-implementation of 'git show' that was able to\n> understand patch names (you can also give any commit id as argument).\n> I later extended it to accept patch ranges.\n> \n> >Also, when presenting GIT/StGIT to co-workers, I found them to be\n> >confused by eg. \"stg push\" and \"stg commit\" having different semantics\n> >than \"git push\" and \"git commit\".\n> \n> As I said in a different e-mail, push/pop were the command names used\n> by quilt. I agree that they are confusing. Maybe we could change\n> commit/uncommit to store/unstore or something else (but I would like\n> to keep push/pop).\n\nOK, the command names were borrowed from tools which provide a\nfraction of the functionnality stgit (not exactly so in the case of\nGIT, OK ;).  That makes it easy for people used to those commands that\nserved as inspiration to the stgit ones, I know that (I used quilt\nbefore stgit).  But I do feel that having a more consistent command\nset would help - remember quilt has no idea of branches, multiple\nrepositories and history, stgit is in many ways a very different beast :)\n\n> You can use the bash aliases if you want (i.e.  'alias\n> stg-ppush=\"stg push\"').\n\nThe argument is not about *me*, I can happily use \"stg push\".  It is\nabout smoothing the learning curve by providing a command set that\nwould be easier to dive in.  One where, for example, the user wanting\nto do some action on a patch, but not remembering the exact command,\ncould confidently use bash completion with \"stg patch <TAB>\" and get\nthe list of patch commands.  That would be easier than having to \"stg\n--help\" and find the command in the full list.\n\nAnd then, legacy commands like \"stg push\" would be better implemented\nas stgit aliases, since an \"stg-push\" shell alias as replacement would\nbreak scripts.\n\n\n> I don't like the idea of command aliases that much, it looks like\n> unneeded complexity.\n\nThere are already aliases in GIT itself, they are quite simple to\nunderstand, and would probably require very little code in python.\nI'll have a look at that, unless you would veto integration of such a\npatch.\n\nBest regards,\n-- \nYann.\n"},{"id":"31607","messageId":"b0943d9e0701121509t6d3ca059v9b7389ff3242c06b@mail.gmail.com","threadId":"6289","inReplyTo":"20070112224733.GA9761@nan92-1-81-57-214-146.fbx.proxad.net","subject":"Re: [PATCH] Add contrib/stg-gitk: helper script to run gitk","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-01-12T23:09:22Z","receivedAt":"2007-01-12T23:09:22Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 12/01/07, Yann Dirson <ydirson@altern.org> wrote:\n> Indeed \"stg series -g\" may differ too much from \"stg-gitk\" to plug the\n> functionnality at this place: \"stg series\" is a command acting on one\n> stack, whereas stg-gitk is a repository-wide command, allowing to draw\n> several stacks, and also includes anything below stack base, which\n> looks also out of the scope of \"stg series -g\".  Maybe a new command\n> is called for - possibly as something like\n> \"stg repo graph [<branch>...]\" ?\n\nMaybe repo --graph at the moment (until we add some unified support\nfor subcommands) but not sure what other options would go into 'repo'.\nAnyway, I haven't had time to try any of your scripts yet and I don't\nknow what stg-gitk shows.\n\n> OK, the command names were borrowed from tools which provide a\n> fraction of the functionnality stgit (not exactly so in the case of\n> GIT, OK ;).  That makes it easy for people used to those commands that\n> served as inspiration to the stgit ones, I know that (I used quilt\n> before stgit).  But I do feel that having a more consistent command\n> set would help - remember quilt has no idea of branches, multiple\n> repositories and history, stgit is in many ways a very different beast :)\n\nStGIT probably got enough advertisement as being a Quilt replacement\nfor GIT. It would be OK to re-organize the commands (and use aliases\nto still have the current functionality).\n\nAs I said in a different e-mail, I'd first like to get StGIT in a\nfeature-freeze state (well, mainly not changing major things) and fix\nthe remaining bugs to get 1.0 out. After that, we can redefine the\ncommands, repository structure or whatever has a bad design.\n\n> There are already aliases in GIT itself, they are quite simple to\n> understand, and would probably require very little code in python.\n> I'll have a look at that, unless you would veto integration of such a\n> patch.\n\nI'd like this patch (though I haven't used aliases in GIT yet).\n\n-- \nCatalin\n"}]}