Commit graph

2517 commits

Author SHA1 Message Date
Paul Gauthier
3e77df7587 /tokens should warn when <1k tokens left 2023-07-25 09:25:01 -03:00
Paul Gauthier
b849d16ec7 Updated HISTORY 2023-07-25 07:22:22 -03:00
Paul Gauthier
fcdd640a09 Strong prompt to never elide code 2023-07-25 07:04:14 -03:00
Paul Gauthier
d146398434 set version to 0.10.1-dev 2023-07-24 15:12:37 -03:00
Paul Gauthier
1f91735e88 version bump to 0.10.1 2023-07-24 15:12:18 -03:00
Paul Gauthier
ece45c7dc2 Bugfix versionbump 2023-07-24 15:12:15 -03:00
Paul Gauthier
62344a39cc Updated HISTORY 2023-07-24 15:06:58 -03:00
Paul Gauthier
d534dffe0a Updated HISTORY 2023-07-24 15:06:21 -03:00
Paul Gauthier
b006b39c6f GPT should ask users to add files to the chat 2023-07-24 14:49:12 -03:00
Paul Gauthier
17729280c6 Merge remote-tracking branch 'origin/main' 2023-07-24 14:05:45 -03:00
Paul Gauthier
745b3c320b Scan the git index using entries, which does not rely on a prior commit 2023-07-24 14:00:35 -03:00
Paul Gauthier
96f15c4533 Be sure to include staged files in get_tracked_files 2023-07-24 13:05:00 -03:00
paul-gauthier
8c6b50c64f
Update install.md 2023-07-23 16:18:30 -03:00
paul-gauthier
e63ae71e3e
Update install.md 2023-07-23 16:17:50 -03:00
Paul Gauthier
e52807b868 cleanup 2023-07-23 10:31:59 -03:00
paul-gauthier
f6e5f4c539
Merge pull request #131 from joshuavial/command-docs
More complete docs for prompt commands
2023-07-23 10:23:10 -03:00
Paul Gauthier
4238986991 Updated HISTORY 2023-07-23 10:16:48 -03:00
paul-gauthier
e2466333ad
Merge pull request #141 from paul-gauthier/issue-139
/add and /drop problems when cwd != git_root #139 #95
2023-07-23 10:08:24 -03:00
Paul Gauthier
699f1598fc Ignore errors (Windows) 2023-07-23 10:04:18 -03:00
Paul Gauthier
0a5155e5bd brought over test_cmd_add_from_subdir from pr #97 2023-07-23 10:00:00 -03:00
Paul Gauthier
450a5fff19 Added test case and fix for /drop too 2023-07-23 08:41:56 -03:00
Paul Gauthier
d785d9a2e2 fix for #139 2023-07-23 08:34:56 -03:00
Paul Gauthier
9352bc67ca Added test case for issue #139 2023-07-23 08:34:19 -03:00
Paul Gauthier
47b550c62f aider: Switched open calls to use Path.write_text.
# Aider chat conversation:

USER: also swith the open calls to use Path.write_text

ASSISTANT: To switch the `open` calls to use `Path.write_text` in `test_cmd_add_drop_directory`, we need to modify the `tests/test_commands.py` file. Here are the changes:

```python
tests/test_commands.py
<<<<<<< ORIGINAL
        with open(Path("test_dir/test_file1.txt"), "w") as f:
            f.write("Test file 1")
        with open(Path("test_dir/test_file2.txt"), "w") as f:
            f.write("Test file 2")
        with open(Path("test_dir/another_dir/test_file.txt"), "w") as f:
            f.write("Test file 3")
=======
        Path("test_dir/test_file1.txt").write_text("Test file 1")
        Path("test_dir/test_file2.txt").write_text("Test file 2")
        Path("test_dir/another_dir/test_file.txt").write_text("Test file 3")
>>>>>>> UPDATED
```

This change replaces the `open` calls with `Path().write_text()` from the pathlib module.
2023-07-23 08:19:17 -03:00
Paul Gauthier
d695fe103b aider: Switched all the os calls to use pathlib in test_cmd_add_drop_directory.
# Aider chat conversation:

USER: switch all the os calls to use pathlib in `test_cmd_add_drop_directory`

ASSISTANT: To switch all the os calls to use pathlib in `test_cmd_add_drop_directory`, we need to modify the `tests/test_commands.py` file. Here are the changes:

```python
tests/test_commands.py
<<<<<<< ORIGINAL
        # Create a directory and add files to it
        os.mkdir("test_dir")
        os.mkdir("test_dir/another_dir")
        with open("test_dir/test_file1.txt", "w") as f:
            f.write("Test file 1")
        with open("test_dir/test_file2.txt", "w") as f:
            f.write("Test file 2")
        with open("test_dir/another_dir/test_file.txt", "w") as f:
            f.write("Test file 3")
=======
        # Create a directory and add files to it using pathlib
        Path("test_dir").mkdir()
        Path("test_dir/another_dir").mkdir()
        with open(Path("test_dir/test_file1.txt"), "w") as f:
            f.write("Test file 1")
        with open(Path("test_dir/test_file2.txt"), "w") as f:
            f.write("Test file 2")
        with open(Path("test_dir/another_dir/test_file.txt"), "w") as f:
            f.write("Test file 3")
>>>>>>> UPDATED
```

This change replaces the `os.mkdir` calls with `Path().mkdir()` from the pathlib module. It also changes the file paths in the `open` calls to use `Path()`.
2023-07-23 08:18:34 -03:00
Paul Gauthier
0e9dbddfde set version to 0.10.0-dev 2023-07-22 09:02:19 -03:00
Paul Gauthier
a1ff22dc20 version bump to 0.10.0 2023-07-22 09:02:03 -03:00
Paul Gauthier
3ac98b3261 cleanup 2023-07-22 08:56:40 -03:00
Paul Gauthier
4e40c8ac15 make .gitignore before making repo 2023-07-22 08:51:57 -03:00
Paul Gauthier
61565b66e1 Updated HISTORY 2023-07-21 16:39:52 -03:00
Paul Gauthier
dfd92073f4 Handle files in the git repo which have been deleted but not committed, with test 2023-07-21 15:41:57 -03:00
Paul Gauthier
6d044485f3 Merge branch 'main' into chat-history 2023-07-21 07:44:09 -03:00
Paul Gauthier
0d6abde253 copy 2023-07-21 07:41:30 -03:00
Paul Gauthier
568be3812b Fix last_keyboard_interrupt in benchmark 2023-07-20 13:25:15 -03:00
Paul Gauthier
567aaea834 Updated HISTORY 2023-07-20 12:06:00 -03:00
Paul Gauthier
d6a4b24306 Exit with 2 ^C in 2 seconds 2023-07-20 11:14:24 -03:00
Paul Gauthier
842ea95de2 Exit with 2 ^C in 3 seconds 2023-07-20 11:13:39 -03:00
Paul Gauthier
a1f2fc4482 Merge branch 'main' into chat-history 2023-07-20 09:55:26 -03:00
Paul Gauthier
bd1811db4d space 2023-07-20 09:53:26 -03:00
Paul Gauthier
750f8a45c6 Changed Discord chat badge to a blue "Join Discord" badge.
# Aider chat conversation:
2023-07-20 09:52:54 -03:00
Paul Gauthier
d7fd4eb8c7 aider: Centered the SVG image and added a Discord badge below it linking to https://discord.gg/SqzfE6bw.
# Aider chat conversation:

USER: center the svg image and place a discord badge below it linking to https://discord.gg/SqzfE6bw

ASSISTANT: To center the SVG image and place a Discord badge below it, we need to modify the README.md file. Here are the changes:

<source>markdown
README.md
<<<<<<< ORIGINAL
![aider screencast](assets/screencast.svg)

- [Discord](https://discord.gg/SqzfE6bw)
=======
<p align="center">
  <img src="assets/screencast.svg" alt="aider screencast">
</p>

<p align="center">
  <a href="https://discord.gg/SqzfE6bw">
    <img src="https://img.shields.io/discord/308323056592486420?logo=discord" alt="chat on Discord">
  </a>
</p>
>>>>>>> UPDATED
</source>

This change centers the SVG image and places a Discord badge below it. The badge links to the provided Discord URL.
2023-07-20 09:51:16 -03:00
Paul Gauthier
46083802c7 cleanup 2023-07-20 09:49:40 -03:00
Paul Gauthier
2d0f789cb9 aider: Increment the version by 0.0.1 and add "-dev" after the version bump.
# Aider chat conversation:

USER: why is it thinking that 0.9.0 is newer than 0.9.0-dev

ASSISTANT: The version comparison is being done using the `packaging.version.parse` function. This function follows the PEP 440 version identification and comparison rules. According to PEP 440, a version like "0.9.0-dev" is considered a pre-release of "0.9.0", and therefore "0.9.0" is considered newer.

If you want "0.9.0-dev" to be considered newer than "0.9.0", you would need to change the version comparison logic. However, this would be against the standard Python versioning rules and is not recommended.

If you still want to proceed with this, please confirm and I will provide the necessary changes.

USER: I added these *read-write* files: scripts/versionbump.py

ASSISTANT: I understand that you want to modify the version comparison logic in your scripts. However, I would like to clarify where exactly you want this change to be made.

The file `scripts/versionbump.py` does not seem to have any version comparison logic that would consider "0.9.0
^C KeyboardInterrupt

USER: instead of adding -dev into the version after the bump, can you instead increment the version by 0.0.1 and then add dev

ASSISTANT: Sure, we can modify the `scripts/versionbump.py` script to increment the version by 0.0.1 and then add "-dev" to it. Here's how we can do it:

1. After the new version is parsed, we can increment the patch version by 1.
2. Then, we can add "-dev" to this incremented version.

Here's the change:

```python
scripts/versionbump.py
<<<<<<< ORIGINAL
    new_version = version.parse(new_version_str)

    with open("aider/__init__.py", "r") as f:
        content = f.read()
=======
    new_version = version.parse(new_version_str)
    incremented_version = version.Version(f"{new_version.major}.{new_version.minor}.{new_version.micro + 1}")

    with open("aider/__init__.py", "r") as f:
        content = f.read()
>>>>>>> UPDATED
```

```python
scripts/versionbump.py
<<<<<<< ORIGINAL
    updated_dev_content = re.sub(
        r'__version__ = ".+?"', f'__version__ = "{new_version}-dev"', content
    )
=======
    updated_dev_content = re.sub(
        r'__version__ = ".+?"', f'__version__ = "{incremented_version}-dev"', content
    )
>>>>>>> UPDATED
```

This will increment the patch version by 0.0.1 and then add "-dev" to it after the version bump.
2023-07-20 09:48:11 -03:00
Paul Gauthier
6cb8f4e762 stop passing content to update_cur_messages 2023-07-20 09:41:38 -03:00
Paul Gauthier
993bfa6e4c cleanup 2023-07-20 09:39:27 -03:00
Paul Gauthier
ea15aa72fa cleanup 2023-07-20 09:34:09 -03:00
Paul Gauthier
25c03535cc aider: Replace deprecated pkg_resources.parse_version with packaging.version.parse for version comparison in aider/versioncheck.py.
# Aider chat conversation:

USER:     warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)

ASSISTANT: It seems like you're concerned about the deprecation warning from the `pkg_resources` module. We can replace the usage of `pkg_resources` with `packaging.version` for version comparison.

Here are the changes needed in the `aider/versioncheck.py` file:

```python
aider/versioncheck.py
<<<<<<< ORIGINAL
import pkg_resources

...

if pkg_resources.parse_version(latest_version) <= pkg_resources.parse_version(
    current_version
):
    return
=======
import packaging.version

...

if packaging.version.parse(latest_version) <= packaging.version.parse(
    current_version
):
    return
>>>>>>> UPDATED
```

This change replaces the deprecated `pkg_resources.parse_version` with `packaging.version.parse` for version comparison.

USER: InvalidEditBlock: edit failed!

aider/versioncheck.py does not contain the *exact sequence* of ORIGINAL lines you specified.
Try again.
DO NOT skip blank lines, comments, docstrings, etc!
The ORIGINAL block needs to be EXACTLY the same as the lines in aider/versioncheck.py with nothing missing!

aider/versioncheck.py does not contain these 8 exact lines in a row:
```
import pkg_resources

...

if pkg_resources.parse_version(latest_version) <= pkg_resources.parse_version(
    current_version
):
    return
```

ASSISTANT: I apologize for the confusion. Let's try again with the correct sequence of lines from the `aider/versioncheck.py` file:

```python
aider/versioncheck.py
<<<<<<< ORIGINAL
import pkg_resources

...

        if pkg_resources.parse_version(latest_version) <= pkg_resources.parse_version(
            current_version
        ):
            return
=======
import packaging.version

...

        if packaging.version.parse(latest_version) <= packaging.version.parse(
            current_version
        ):
            return
>>>>>>> UPDATED
```

This change replaces the deprecated `pkg_resources.parse_version` with `packaging.version.parse` for version comparison.
2023-07-20 08:45:58 -03:00
Paul Gauthier
8627b39c97 Updated HISTORY 2023-07-20 08:44:50 -03:00
Paul Gauthier
cc59b10a73 wire into main 2023-07-20 08:43:03 -03:00
Paul Gauthier
12cf19010f Refactor check_version function to accept a print_cmd argument and update print statements accordingly.
# Aider chat conversation:
2023-07-20 08:37:44 -03:00