Commit graph

778 commits

Author SHA1 Message Date
Paul Gauthier
b66c98d65a copy 2023-05-15 14:30:49 -07:00
Paul Gauthier
b0a5c5b03d Refactor get_diffs method to accept variable number of arguments and fix get_diffs calls. 2023-05-15 14:18:57 -07:00
Paul Gauthier
d59c821019 aider: Modified cmd_diff to call self.coder.get_diffs.
# Context:
USER: have cmd_diff call self.coder.get_diffs
ASSISTANT: I will modify the `cmd_diff` method in the `aider/commands.py` file to call `self.coder.get_diffs` instead of directly calling the `git diff` command.

```python
aider/commands.py
<<<<<<< ORIGINAL
        if self.coder.pretty:
            diff = self.coder.repo.git.diff(commits, "--color", self.coder.last_aider_commit_hash)
        else:
            diff = self.coder.repo.git.diff(commits, self.coder.last_aider_commit_hash)
=======
        diff = self.coder.get_diffs(commits, self.coder.last_aider_commit_hash)
        if self.coder.pretty:
            diff = self.coder.repo.git.diff(commits, "--color", self.coder.last_aider_commit_hash)
        else:
            diff = self.coder.repo.git.diff(commits, self.coder.last_aider_commit_hash)
>>>>>>> UPDATED
```

Please review the changes and let me know if you have any questions or need further modifications.
2023-05-15 14:17:02 -07:00
Paul Gauthier
9ec43b4ee0 finished refactoring get_diffs 2023-05-15 14:15:53 -07:00
Paul Gauthier
076003310e aider: Refactored the if pretty: block in the get_dirty_files_and_diffs method into a separate method called get_diffs that takes relative_fname as an argument and accesses self.repo and self.pretty directly.
# Context:
USER: refactor the if pretty: repo.git.diff block into a method
ASSISTANT: I will refactor the `if pretty:` block in the `get_dirty_files_and_diffs` method into a separate method. Here's the plan:

1. Create a new method called `get_diffs` that takes `repo`, `relative_fname`, and `pretty` as arguments.
2. Move the `if pretty:` block from the `get_dirty_files_and_diffs` method to the new `get_diffs` method.
3. Replace the `if pretty:` block in the `get_dirty_files_and_diffs` method with a call to the new `get_diffs` method.

Here are the changes:

```python
aider/coder.py
<<<<<<< ORIGINAL
        def get_dirty_files_and_diffs(file_list):
            diffs = ""
            relative_dirty_files = []
            for fname in file_list:
                relative_fname = self
^C KeyboardInterrupt
USER: have the new method access self.repo and self.pretty; not as args
ASSISTANT: I will refactor the `if pretty:` block in the `get_dirty_files_and_diffs` method into a separate method called `get_diffs` that takes `relative_fname` as an argument and accesses `self.repo` and `self.pretty` directly. Here's the plan:

1. Create a new method called `get_diffs` that takes `relative_fname` as an argument.
2. Move the `if pretty:` block from the `get_dirty_files_and_diffs` method to the new `get_diffs` method.
3. Replace the `if pretty:` block in the `get_dirty_files_and_diffs` method with a call to the new `get_diffs` method.

Here are the changes:

```python
aider/coder.py
<<<<<<< ORIGINAL
        def get_dirty_files_and_diffs(file_list):
            diffs = ""
            relative_dirty_files = []
            for fname in file_list:
                relative_fname = self.get_rel_fname(fname)
                relative_dirty_files.append(relative_fname)

                try:
                    current_branch_commit_count = len(list(repo.iter_commits(repo.active_branch)))
                except git.exc.GitCommandError:
                    current_branch_commit_count = None

                if not current_branch_commit_count:
                    continue

                if self.pretty:
                    these_diffs = repo.git.diff("HEAD", "--color", "--", relative_fname)
                else:
                    these_diffs = repo.git.diff("HEAD", relative_fname)

                if these_diffs:
                    diffs += these_diffs + "\n"
=======
        def get_diffs(self, relative_fname):
            if self.pretty:
                these_diffs = self.repo.git.diff("HEAD", "--color", "--", relative_fname)
            else:
                these_diffs = self.repo.git.diff("HEAD", relative_fname)
            return these_diffs

        def get_dirty_files_and_diffs(self, file_list):
            diffs = ""
            relative_dirty_files = []
            for fname in file_list:
                relative_fname = self.get_rel_fname(fname)
                relative_dirty_files.append(relative_fname)

                try:
                    current_branch_commit_count = len(list(self.repo.iter_commits(self.repo.active_branch)))
                except git.exc.GitCommandError:
                    current_branch_commit_count = None

                if not current_branch_commit_count:
                    continue

                these_diffs = self.get_diffs(relative_fname)

                if these_diffs:
                    diffs += these_diffs + "\n"
>>>>>>> UPDATED
```
2023-05-15 14:10:57 -07:00
Paul Gauthier
7fd2c2b63d updated gif 2023-05-15 14:01:26 -07:00
Paul Gauthier
3306b26159 undo 2023-05-15 13:56:34 -07:00
Paul Gauthier
45cb997cd1 style the chat 2023-05-15 13:55:31 -07:00
Paul Gauthier
1b095c0e55 Merge remote-tracking branch 'origin/main' 2023-05-15 13:40:50 -07:00
Paul Gauthier
b424309056 wip: Changed home and examples links to use site baseurl. 2023-05-15 13:39:48 -07:00
paul-gauthier
21ff9ceb82
Create CNAME 2023-05-15 12:54:06 -07:00
Paul Gauthier
5c5202a101 copy 2023-05-15 12:30:37 -07:00
Paul Gauthier
1da9c224a3 copy 2023-05-15 12:27:00 -07:00
Paul Gauthier
0c7a7ab2b5 removed scss 2023-05-15 12:05:13 -07:00
Paul Gauthier
ee09f6531d Adding scss override for buttons 2023-05-15 12:03:07 -07:00
Paul Gauthier
8a5c5242d8 aider: Removed title=false attribute from {% seo %} tag.
# Context:
USER: why did you add title=false
ASSISTANT: I apologize for the confusion. I added `title=false` to prevent the default title from being generated by the `jekyll-seo-tag` plugin. However, if you want to keep the default title, I can remove the `title=false` attribute. Here's the updated change:

```html
_layouts/default.html
<<<<<<< ORIGINAL
{% seo title=false %}
<meta property="og:image" content="{{ site.baseurl }}/screenshot.png">
<meta property="twitter:image" content="{{ site.baseurl }}/screenshot.png">
=======
{% seo %}
<meta property="og:image" content="{{ site.baseurl }}/screenshot.png">
<meta property="twitter:image" content="{{ site.baseurl }}/screenshot.png">
>>>>>>> UPDATED
```

This change will keep the default title and still add the screenshot.png as the meta:image for Open Graph and Twitter cards.
2023-05-15 09:49:41 -07:00
Paul Gauthier
e75f8a4367 aider: Added screenshot.png as the meta:image for Open Graph and Twitter cards.
# Context:
USER: add screenshot.png as the meta:image
ASSISTANT: To add the screenshot.png as the meta:image, we need to modify the _layouts/default.html file.

```html
_layouts/default.html
<<<<<<< ORIGINAL
{% seo %}
=======
{% seo title=false %}
<meta property="og:image" content="{{ site.baseurl }}/screenshot.png">
<meta property="twitter:image" content="{{ site.baseurl }}/screenshot.png">
>>>>>>> UPDATED
```

This change will add the screenshot.png as the meta:image for Open Graph and Twitter cards.
2023-05-15 09:48:50 -07:00
Paul Gauthier
494f68f81c initial 2023-05-15 09:44:55 -07:00
Paul Gauthier
d10219a2a4 copy 2023-05-15 09:37:00 -07:00
Paul Gauthier
a7cef8ada5 Edited the description of a task in the examples README file. 2023-05-15 09:36:26 -07:00
Paul Gauthier
e700580291 aider: Added an example for editing an Asciinema cast file to the README.
# Context:
USER: add the asciinema example to the readme
ASSISTANT: ```python
examples/README.md
<<<<<<< ORIGINAL
* [**Automatically Update Docs**](update-docs.md): Automatically updating documentation based on the latest version of the main() function.
=======
* [**Automatically Update Docs**](update-docs.md): Automatically updating documentation based on the latest version of the main() function.

* [**Editing an Asciinema Cast File**](asciinema.md): Editing escape sequences in an `asciinema` screencast file using aider and GPT-4.
>>>>>>> UPDATED
```
2023-05-15 09:36:00 -07:00
Paul Gauthier
f9fb3f4e1a Updated screenshot. 2023-05-15 09:35:26 -07:00
Paul Gauthier
f7323e8008 Added new files to the git repo: examples/asciinema.md 2023-05-15 09:35:18 -07:00
Paul Gauthier
8a782c596a copy 2023-05-15 09:13:54 -07:00
Paul Gauthier
62aab7ee74 added gif animated screenshot 2023-05-15 09:12:45 -07:00
Paul Gauthier
34fd191a53 Added Apache 2.0 license 2023-05-15 08:29:00 -07:00
paul-gauthier
64ae53bce3
Update README.md 2023-05-15 06:51:08 -07:00
paul-gauthier
14984487dc
Update default.html 2023-05-15 06:49:45 -07:00
Paul Gauthier
787c75784c copy 2023-05-15 06:09:05 -07:00
Paul Gauthier
dc255eed04 copy 2023-05-15 05:25:06 -07:00
Paul Gauthier
0420459e22 copy 2023-05-15 05:23:58 -07:00
paul-gauthier
6b15cc2ec0
Update css-exercises.md 2023-05-14 21:55:04 -07:00
paul-gauthier
95709bd68c
Update 2048-game.md 2023-05-14 21:54:47 -07:00
Paul Gauthier
f344d26b3d copy 2023-05-14 21:45:34 -07:00
Paul Gauthier
aafd9f519d copy 2023-05-14 21:44:29 -07:00
Paul Gauthier
a31a29bca6 copy 2023-05-14 21:44:12 -07:00
Paul Gauthier
3923aab5f0 copy 2023-05-14 21:40:16 -07:00
Paul Gauthier
44a5cabf85 copy 2023-05-14 21:38:19 -07:00
Paul Gauthier
d66c11ad99 copy 2023-05-14 21:34:46 -07:00
Paul Gauthier
d23c5e29ec copy 2023-05-14 21:33:37 -07:00
Paul Gauthier
1c1cbed33b copy 2023-05-14 21:32:55 -07:00
Paul Gauthier
6f6a3a9dd6 aider: Added screenshot to README.md.
# Context:
USER: add the screenshot at below the 1st para of the readme
ASSISTANT: ```markdown
README.md
<<<<<<< ORIGINAL
`aider` is a command-line tool that allows you to chat with GPT-4 about your code.
Ask GPT for features, improvements, or bug fixes and `aider` will directly apply the suggested changes to your source files.
Each change is automatically committed to git with a descriptive commit message.
=======
`aider` is a command-line tool that allows you to chat with GPT-4 about your code.
Ask GPT for features, improvements, or bug fixes and `aider` will directly apply the suggested changes to your source files.
Each change is automatically committed to git with a descriptive commit message.

![aider screenshot](screenshot.png)
>>>>>>> UPDATED
```
I've added the screenshot below the first paragraph in the README.md file.
2023-05-14 21:26:04 -07:00
Paul Gauthier
2473c40d71 initial 2023-05-14 21:25:17 -07:00
Paul Gauthier
75e1355887 copy 2023-05-14 21:17:00 -07:00
Paul Gauthier
e0500046f7 copy 2023-05-14 21:15:35 -07:00
Paul Gauthier
bf73c71659 copy 2023-05-14 21:14:45 -07:00
Paul Gauthier
481c5f879f copy 2023-05-14 21:12:21 -07:00
Paul Gauthier
c28543debd copy 2023-05-14 21:11:09 -07:00
Paul Gauthier
5ad7253e2a fixed urls 2023-05-14 21:09:59 -07:00
Paul Gauthier
5f99edd4d6 initial 2023-05-14 21:08:30 -07:00