That works great thanks! On Sun, Aug 26, 2018 at 9:21 AM Edward K. Ream <edream...@gmail.com> wrote:
> On Saturday, August 25, 2018 at 10:26:17 AM UTC-5, Paul Dumais wrote: > > How is git-diff generally used? When I launch leo, current working >> directory is set as my home directory, but I wan to use the git-diff >> command on a particular directory. But git-diff seems to only work on the >> current working directory. How do I change this to work on my git >> repository? >> > > Here, the best answer is in the code. Searching for 'git-diff' in > leoPy.leo eventually leads to the GitDiffController class, in @file > ../commands/editFileCommands.py. > > gdc.git_diff does the work. Its signature is: > > git_diff(self, directory=None, rev1='HEAD', rev2=''): > > So scripts could the directory kwarg, but what does this kwarg mean? The > git_diff method starts with: > > if not self.set_directory(directory): > return > > Looking at gdc.set_directory, we see that it defaults to os.curdir, that > is, the current working directory. > > Finally, looking at gdc.find_git_working_directory, we see that it looks > for a .git directory in the given directory, or all *parent* directories. > > In short, there are two possible answers to your question. > > 1. Set your computer's working directory to a directory containing the > desired .git directory. > > 2. Write a script (@button node, say), that sets the "directory" kwarg as > desired. Something like this: > > import leo.commands.editFileCommands as efc > > efc.GitDiffController(c).git_diff( > directory="your desired directory", > ) > > HTH. > > Edward > > -- > You received this message because you are subscribed to the Google Groups > "leo-editor" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to leo-editor+unsubscr...@googlegroups.com. > To post to this group, send email to leo-editor@googlegroups.com. > Visit this group at https://groups.google.com/group/leo-editor. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To post to this group, send email to leo-editor@googlegroups.com. Visit this group at https://groups.google.com/group/leo-editor. For more options, visit https://groups.google.com/d/optout.