Paul Gauthier
5527e8e433
show a . prompt during multiline
2023-05-08 22:46:20 -07:00
Paul Gauthier
42598e2329
Modify get_input() to accumulate input lines between { and } and return the concatenated lines with '\n'.
...
# Context:
USER: modify get_input(). if the user inputs a line with just { then keep accumulating input lines until you receive a line with just }. in this case, discard the {} lines and return the rest of the lines concatenated with '\n'
ASSISTANT: To modify the `get_input()` function to accumulate input lines between `{` and `}`, we will change the function to handle this case.
Here's the updated code for the `get_input()` function:
```python
coder.py
<<<<<<< ORIGINAL
def get_input(self):
if self.pretty:
self.console.rule()
else:
print()
inp = ""
if self.pretty:
print(Fore.GREEN, end="\r")
else:
print()
while not inp.strip():
try:
inp = input("> ")
except EOFError:
return
###
if self.pretty:
print(Style.RESET_ALL)
else:
print()
readline.write_history_file(history_file)
return inp
=======
def get_input(self):
if self.pretty:
self.console.rule()
else:
print()
inp = ""
multiline_input = False
if self.pretty:
print(Fore.GREEN, end="\r")
else:
print()
while True:
try:
line = input("> ")
except EOFError:
return
if line.strip() == "{" and not multiline_input:
multiline_input = True
continue
elif line.strip() == "}" and multiline_input:
break
elif multiline_input:
inp += line + "\n"
else:
inp = line
break
if self.pretty:
print(Style.RESET_ALL)
else:
print()
readline.write_history_file(history_file)
return inp
>>>>>>> UPDATED
```
This change will allow the `get_input()` function to accumulate input lines between `{` and `}` and return the concatenated lines with '\n'.
2023-05-08 22:43:39 -07:00
Paul Gauthier
551cc011aa
enforce a min similarity to do the edit
2023-05-08 22:42:16 -07:00
Paul Gauthier
7138649bd9
more flexibly search/replace for ORIGINAL/UPDATED
2023-05-08 22:37:16 -07:00
Paul Gauthier
ecdbc762d9
WIP: Added find_block function to coder.py.
2023-05-08 22:06:50 -07:00
Paul Gauthier
6175d05979
WIP: Changed console print statements to include bold text.
2023-05-08 21:58:41 -07:00
Paul Gauthier
396e7b1977
log the relevant conversation in the commit message
2023-05-08 21:38:21 -07:00
Paul Gauthier
d92749f808
only show diffs and commit message if the user is being asked to confirm the commit
2023-05-08 21:30:51 -07:00
Paul Gauthier
daac07c062
explicitly find and report untracked files
2023-05-08 21:24:47 -07:00
Paul Gauthier
d32ae99de9
Update set_repo function to check if file is tracked using git ls-files command.
2023-05-08 21:21:18 -07:00
Paul Gauthier
c9c55aff97
WIP: Updated error messages for git repo detection.
2023-05-08 21:19:33 -07:00
Paul Gauthier
e89588aa01
Refactor set_repo() to add and commit all new files at once.
2023-05-08 21:16:31 -07:00
Paul Gauthier
ec486f8504
Add commit message to new files added in set_repo() method.
2023-05-08 21:14:06 -07:00
Paul Gauthier
6781584d67
Revert "Updated commit message prefix to "Initial commit: Added new files." in coder.py."
...
This reverts commit 6d298281fc
.
2023-05-08 21:13:02 -07:00
Paul Gauthier
6d298281fc
Updated commit message prefix to "Initial commit: Added new files." in coder.py.
2023-05-08 21:12:05 -07:00
Paul Gauthier
65e6a0abde
Add ability to check if files are untracked and add them to the git repo.
2023-05-08 21:11:34 -07:00
Paul Gauthier
ffc44bd014
warn the user if the files aren't in the same repo
2023-05-08 21:10:40 -07:00
Paul Gauthier
880e90566d
Refactor set_repo() to add check_for_local_edits() and remove duplicated code in commit() to rely on self.repo.
2023-05-08 20:59:16 -07:00
Paul Gauthier
5afeb29c94
Add set_repo() function to set self.repo to the single repository that all the files belong to.
2023-05-08 20:57:19 -07:00
Paul Gauthier
cc50c380f8
Add bold formatting to commit hash in console output.
2023-05-08 20:44:21 -07:00
Paul Gauthier
d03a209ed0
WIP: Added file creation and loading messages
2023-05-08 20:42:38 -07:00
Paul Gauthier
d279f9751f
lint
2023-05-08 20:31:01 -07:00
Paul Gauthier
aba0b96904
Moved new imports to the top of the file.
2023-05-08 17:37:42 -07:00
Paul Gauthier
06351d3205
Handle openai.error.RateLimitError
and retry requests with a delay.
2023-05-08 17:36:53 -07:00
Paul Gauthier
a85cc59120
Added saved_message variable to tell gpt the git hash/msg
2023-05-08 17:35:46 -07:00
Paul Gauthier
e5cbc5cc4c
Refactor commit method to accept history parameter.
2023-05-08 17:21:36 -07:00
Paul Gauthier
8b920f778e
show hash and message on commit
2023-05-08 17:17:41 -07:00
Paul Gauthier
e2e21fc68e
Added ability to customize commit message when prompted.
2023-05-08 17:17:02 -07:00
Paul Gauthier
4be0c6945b
Refactor Confirm.ask message in coder.py.
2023-05-08 17:12:54 -07:00
Paul Gauthier
e162f053c8
Print diffs and commit message separately.
2023-05-08 17:11:20 -07:00
Paul Gauthier
ea63f9b31f
Add dump function call to main function.
2023-05-08 17:06:02 -07:00
Paul Gauthier
a096c6e5e4
Add --commit flag to commit dirty files without confirmation
2023-05-08 17:04:49 -07:00
Paul Gauthier
f9569e7645
Added ability to commit only dirty files.
2023-05-08 17:00:15 -07:00
Paul Gauthier
e824dd1c68
wip commit
2023-05-08 16:55:15 -07:00
Paul Gauthier
4311b2117a
fixed pattern to handle files without extensions
2023-05-08 14:28:37 -07:00
Paul Gauthier
c02501d690
commit wip
2023-05-08 14:16:22 -07:00
Paul Gauthier
1dc8b3cd31
fix send() output
2023-05-08 11:44:51 -07:00
Paul Gauthier
0f040949c4
commit wip
2023-05-08 11:41:51 -07:00
Paul Gauthier
b0d2fafdd5
commit wip
2023-05-08 10:41:54 -07:00
Paul Gauthier
71103dd87f
red
2023-05-08 10:32:17 -07:00
Paul Gauthier
387da4beab
cleanup
2023-05-08 10:30:17 -07:00
Paul Gauthier
502d6b22d4
fixed regex
2023-05-08 10:23:07 -07:00
Paul Gauthier
557bf5ae76
prompt for new files
2023-05-08 10:17:42 -07:00
Paul Gauthier
1b72656618
Tighter regex to find the filename
2023-05-08 09:18:14 -07:00
Paul Gauthier
943a789874
added --apply arg
2023-05-08 09:05:12 -07:00
Paul Gauthier
8ac27839df
Gracefully handle ^C and let gpt see that the user interrupted it
2023-05-08 08:49:28 -07:00
Paul Gauthier
e1fd8b0edc
fully implement --no-pretty
2023-05-08 08:29:14 -07:00
Paul Gauthier
936c5043fa
use colorama to work around buggy rich input
2023-05-08 08:13:52 -07:00
Paul Gauthier
5ec57a221b
switch to --no-colorize
2023-05-08 07:50:44 -07:00
Paul Gauthier
e6137a78cf
added --colorize
2023-05-08 07:49:03 -07:00