{"thread":{"id":"4615","subject":"Added macro support to qgit","startedAt":"2006-06-22T14:04:55Z","lastAt":"2006-06-23T20:15:49Z","messageCount":4,"participants":["Marco Costalba","Pavel Roskin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"22278","messageId":"e5bfff550606220704q568d8345o1420a0a3e29544e8@mail.gmail.com","threadId":"4615","inReplyTo":null,"subject":"Added macro support to qgit","fromName":"Marco Costalba","fromEmail":"mcostalba@gmail.com","sentAt":"2006-06-22T14:04:55Z","receivedAt":"2006-06-22T14:04:55Z","isPatch":false,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"I have pushed some patches that add macros to qgit.\n\n>From menu bar it is possible to  run a macro created by a fancy new\ndialog invoked by 'Macros->Setup macros...' menu.\n\nSee http://digilander.libero.it/mcostalba/macros_menu.png\n        http://digilander.libero.it/mcostalba/macros_dialog.png\n\nA macro can be associated to a any sequence of commands or to an\nexternal script.\n\nIn case of commands sequence, these will be wrapped up in a temporary\nscript and executed as a whole.\n\nA macro can also ask for command line arguments before to be run so to\nallow for maximum flexibility. In case of multi commands sequence\ngiven command line arguments will be bounded to first one only.\n\nWhile a macro is running a terminal window is shown to display the\ncorresponding output.\n\nqgit repository is: git://git.kernel.org/pub/scm/qgit/qgit.git\n\nComments and feedback are welcomed.\n\n     Marco\n"},{"id":"22325","messageId":"1151024452.5205.46.camel@dv","threadId":"4615","inReplyTo":"e5bfff550606220704q568d8345o1420a0a3e29544e8@mail.gmail.com","subject":"Re: Added macro support to qgit","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2006-06-23T01:00:52Z","receivedAt":"2006-06-23T01:00:52Z","isPatch":false,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hello, Marco!\n\nOn Thu, 2006-06-22 at 16:04 +0200, Marco Costalba wrote:\n> I have pushed some patches that add macros to qgit.\n> \n> From menu bar it is possible to  run a macro created by a fancy new\n> dialog invoked by 'Macros->Setup macros...' menu.\n\nI'm not sure they can be called macros.  Macro is something consisting\nof several commands that are already implemented.  So, a macro-assembler\nis a program that allows to combine several supported instructions into\none macro.  Macros in editors record actions already implemented by the\neditors.  You may also want to read this:\nhttp://en.wikipedia.org/wiki/Macro\n\nIf I understand correctly, qgit doesn't do that.  It calls external\ncommands that are not implemented internally, and it doesn't aggregate\nanything.  Then why not call them \"external commands\"?\n\nThe interface is quite confusing.  I see 5 buttons on top, all of which\nare enabled, plus one button labeled as \"...\", three checkboxes, one\nsingle-line entry and one multiline entry.  I have no I idea where to\nstart.  Should I click \"new\" or white something and then click \"new\"?\nAnd where's \"Cancel\"?.\n\nThat's what I have tried:\n\nEnter \"foo bar\" in the multiline entry.\nClick \"New\"\nEnter \"foobar\"\nClick \"New\"\nEnter \"abc\"\nSelect \"foobar\"\n\nNow \"Run external script\" is selected and \"foo bar\" is gone!  I believe\nuser input should not be discarded without a warning.\n\nI also tried something more meaningful.  I create a \"pull\" macro as an\nexternal script \"stg pull\".  It didn't work.  Am I supposed to supply\nfull path?  Does it understand arguments?  It the script supposed to be\nin a certain format?  OK, stg is written in python, but how about\ncg-status, a shell script?  It doesn't seen to work either.\n\nI could make macros work when I entered the under \"Insert commands to\nrun\".  The output window looks nice.  But I see no indication whether\nthe script is running or it has finished.  I don't see how to terminate\nthe script \"gently\", an equivalent of Ctrl-C.\n\nAs far as I understand, the text entries should not be enabled at the\nsame time.  But it saw it happening when there were no macros at all.\nAnd if I delete all macros, \"Insert commands to run\" doesn't work at\nall.\n\nWhat happens to the arguments qgit is asking for if a multiline entry is\nexecuted?  I understand they are prepended to the first line.  This is\nnot quite logical.  Wouldn't it be better to have a shell like notation\nfor them?\n\nI see the macros are saved in the qgit configuration for the\nuser .qt/qgitrc, like this:\n\n[Macro reset]\ncommands=echo\\nstg pull\\necho 123\\nsleep 5\npatch_flags=9040\nscript_path=/home/proski/bin/cg-reset\n\nShouldn't only one of commands and script_path be saved?  Whouldn't it\nbe better to save meaningful boolean options instead of the opaque\nbinary \"patch_flags\"\n\nAnd what is \"macro_name=New macro\" in [General]?\n\nI think I should write you what I would like to see in qgit, but that\nwould be a separate e-mail.\n\n-- \nRegards,\nPavel Roskin\n"},{"id":"22366","messageId":"e5bfff550606231044j4586ea65v191f86a869237b84@mail.gmail.com","threadId":"4615","inReplyTo":"1151024452.5205.46.camel@dv","subject":"Re: Added macro support to qgit","fromName":"Marco Costalba","fromEmail":"mcostalba@gmail.com","sentAt":"2006-06-23T17:44:54Z","receivedAt":"2006-06-23T17:44:54Z","isPatch":false,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"Hi Pavel,\n\n> If I understand correctly, qgit doesn't do that.  It calls external\n> commands that are not implemented internally, and it doesn't aggregate\n> anything.  Then why not call them \"external commands\"?\n>\n\nOr just \"commands\"? in any case I agree \"macro\" was not a good choice.\n\n> The interface is quite confusing.  I see 5 buttons on top, all of which\n> are enabled, plus one button labeled as \"...\", three checkboxes, one\n> single-line entry and one multiline entry.  I have no I idea where to\n> start.  Should I click \"new\" or white something and then click \"new\"?\n> And where's \"Cancel\"?.\n>\n> That's what I have tried:\n>\n> Enter \"foo bar\" in the multiline entry.\n> Click \"New\"\n> Enter \"foobar\"\n> Click \"New\"\n> Enter \"abc\"\n> Select \"foobar\"\n>\n> Now \"Run external script\" is selected and \"foo bar\" is gone!  I believe\n> user input should not be discarded without a warning.\n>\n\nThe bug is qgit lets you write the first foo bar, before you press NEW\nbutton. It shouldn't. Also some buttons enable/disable policy could be\ngood.\n\n> I also tried something more meaningful.  I create a \"pull\" macro as an\n> external script \"stg pull\".  It didn't work.  Am I supposed to supply\n> full path?  Does it understand arguments?  It the script supposed to be\n> in a certain format?  OK, stg is written in python, but how about\n> cg-status, a shell script?  It doesn't seen to work either.\n>\n\nYou are not supposed to supply full path, any executable file should\nbe OK and yes, you could supply arguments. You don't see nothing\nbecause of a silly bug.\n\n> What happens to the arguments qgit is asking for if a multiline entry is\n> executed?  I understand they are prepended to the first line.  This is\n> not quite logical.  Wouldn't it be better to have a shell like notation\n> for them?\n>\n\nI thought of commands sequence as a quick way to run some simple\ncommands as git pull, git push or similar without writing a bash\nscript, i.e. no $1 for arguments. If you need something more complex\nthe external script is supposed to be the proper way.\n\nPerhaps we could remove the external script single edit line and use\nonly the multiline edit to let user insert commands or script.\n\n> I see the macros are saved in the qgit configuration for the\n> user .qt/qgitrc, like this:\n>\n\nWell, this file is really not meant to be view nor to be modified by\nhand, it is mainly a qgit 'private' thing stuff. Being qgit a GUI tool\nwith a (nice ;-)  ) settings dialog, configuration file is mainly used\nfor persistency, not for browsing/setup.\n\nI hope to fix the external commands interface bugs this week-end.\n\nThanks for your reports\nMarco\n"},{"id":"22371","messageId":"1151093749.10112.11.camel@dv","threadId":"4615","inReplyTo":"e5bfff550606231044j4586ea65v191f86a869237b84@mail.gmail.com","subject":"Re: Added macro support to qgit","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2006-06-23T20:15:49Z","receivedAt":"2006-06-23T20:15:49Z","isPatch":false,"sender":{"key":"proski@gnu.org","avatar":null},"body":"On Fri, 2006-06-23 at 19:44 +0200, Marco Costalba wrote:\n\n> Or just \"commands\"? in any case I agree \"macro\" was not a good choice.\n\nFor a menubar entry, something short is preferred, so \"Commands\" or\n\"Actions\" would be better than \"external commands\".  Emacs calls it\n\"Tools\".  But for a menu entry and the dialog title, \"external commands\"\nwould be better.\n\n> The bug is qgit lets you write the first foo bar, before you press NEW\n> button. It shouldn't. Also some buttons enable/disable policy could be\n> good.\n\nDefinitely.\n\n> > What happens to the arguments qgit is asking for if a multiline entry is\n> > executed?  I understand they are prepended to the first line.  This is\n> > not quite logical.  Wouldn't it be better to have a shell like notation\n> > for them?\n\nI meant appended, sorry.\n\n> I thought of commands sequence as a quick way to run some simple\n> commands as git pull, git push or similar without writing a bash\n> script, i.e. no $1 for arguments. If you need something more complex\n> the external script is supposed to be the proper way.\n\nI think the checkbox controlling whether to ask for arguments allows\nselection between \"simple\" and \"complex\" commands.\n\n> Perhaps we could remove the external script single edit line and use\n> only the multiline edit to let user insert commands or script.\n\nI agree.\n\n> > I see the macros are saved in the qgit configuration for the\n> > user .qt/qgitrc, like this:\n\n> Well, this file is really not meant to be view nor to be modified by\n> hand, it is mainly a qgit 'private' thing stuff. Being qgit a GUI tool\n> with a (nice ;-)  ) settings dialog, configuration file is mainly used\n> for persistency, not for browsing/setup.\n\nOK\n\n> I hope to fix the external commands interface bugs this week-end.\n\nI'm looking forward to testing it.\n\n-- \nRegards,\nPavel Roskin\n"}]}