Hacker Newsnew | past | comments | ask | show | jobs | submit | IceMichael's commentslogin

Wall of text


Reader view


The title alone should receive a downvote. We don't need more of this hype


Okay, so all search engines suck. Yeah, that matches my experience


So what is the USP of this one against the others? I tried my simple favorite one where all of these tools fail (prompt has more details): Write a script that converts git-diff output to a file that can be easily grepped by filename and linenumber.

Never works. And I point then to the errors to clarify in quite a few iterations. Will never be fixed. I did not find any tool that can do that.

The answer from this tool is just the same garbage than with ChatGPT. Not better, not worse, same shit.

Maybe... we don't need more of these?


I am not sure how you may have gone about it but I was able to get this script, from ChatGPT4:

  #!/bin/bash
# Script to convert git diff output to a searchable format

# Check if a git repository if [ ! -d .git ]; then echo "This directory is not a git repository." exit 1 fi

# Filename for the output output_file="git_diff_searchable.txt"

# Empty the output file or create it if it doesn't exist > "$output_file"

# Process git diff output git diff --unified=0 | while read line; do # Check for filename line if [[ $line =~ ^diff ]]; then filename=$(echo $line | sed 's/diff --git a\/\(.\) b\/./\1/') elif [[ $line =~ ^@@ ]]; then # Extract line numbers line_numbers=$(echo $line | sed -E 's/@@ -[0-9]+(,[0-9]+)? \+([0-9]+)(,[0-9]+)? @@./\2/') else # Write filename and line number to the output file echo "$filename:$line_numbers: $line" >> "$output_file" fi done

echo "Output saved to $output_file"

I then ran the following egrep [corrected to egrep, after mistakenly putting that I used gawk] command egrep -e 'agent.rs:[0-9]{1,}' git_diff_searchable.txt* to see the results. Everything worked as I expected.

Now, I don't claim that this is what you intended to achieve but I prompted it with the context of what you asked: Write a script that converts git-diff output to a file that can be easily grepped by filename and linenumber.


However, I did do some prompt "engineering" alongside using your literal request. I definitely should make it clear that I didn't only use your request verbatim but I augmented it a bit with some additional prompting cues.


I'm not sure how to read your comment as everything in the script seems to be a comment? Probably format messed up.

What it usually fails at (maybe 4 can do it, I only use 3.5) is that the output should have one line per line-number, so nothing like 9-15 but 9,10,11,12 etc. I made this very explicit, I gave also examples on how the output should look like. Nothing helped.

Also, I explicitly set it should work under macOS but there were many syntax errors or uses of grep that are incompatible with macOS. So maybe part of it would have worked with linux, not sure. If you can maybe reformat, I could check


When will the hype curve finally end...


Would have liked to see the html part too


You should be able to if you click view source in the example.

It’s a lot of not that interesting code so I didn’t include it in the blog post.


exactly, I would have liked the grisp of the interesting part of it



"exactly, I would have liked the grisp of the interesting part of it"

And that is all, no interesting excerpt, I was able to get source code of the entire page myself :) You are writing an article/tutorial. This kind of work should be in, this was my initial feedback.


I get that this is really interesting and I surely enjoyed the read... But has it really any practical implications? I mean, in a sense, there are so many mathematical riddles... Anyways, I'm fine to ignore this question. Very nice!


Before someone jumps at you for daring to ask this question... yes, there are many many math riddles, and indeed not all are equally important, and we may not always know in advance which ones are.

Some turn out to be more "productive" in the sense of leading to development of techniques, connections to other fields, etc.

Ramsey theory (the riddle discussed in the article) is one of these, here is just a short list of nontrivial applications to CS (admittedly, mostly to theory of CS):

https://www.cs.umd.edu/~gasarch/TOPICS/ramsey/ramsey.html


Interesting, thank you!


Not sure, one can just state that chaos does not exist as with a huge number of items (10^200+) some sort of a rule always emerges.


Isn't typescript the typescript of C++?


Testing hugely via expensive integration tests or E2E is needed no matter which software you have. And you could easily fall into doing that for microservice architectures. However, a common way is rather having contract tests. Google Fowler's article for it


Noone needs a paywall article, why does this even come up here?


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: