GNUWeeb / GNUWeebBot

High-performance bot Telegram, running on Linux environment, written in C.
GNU General Public License v2.0
13 stars 8 forks source link

Aliwoto dev #3

Closed ALiwoto closed 3 years ago

ALiwoto commented 3 years ago

structures for receiving events!

ammarfaizi2 commented 3 years ago

You didn't add the header files. Where are they? Make sure you do git add before git commit if you create new files.

Please git add them and git push to your branch.

ammarfaizi2 commented 3 years ago

It's your first real PR to this project, and it's a very bad PR.

What's the problem?

So, what's the fix for this?

0. typedef

1. Convert JSON string to C structs

I need a function to convert JSON string to these C structs.

My recommendation regarding JSON

2. Revert gwbot.c with its original content

Steps:

  1. Take a deep breath and relax your body.

  2. git status Make sure you see: nothing to commit, working tree clean. If there is uncommited thing, clean it up first.

  3. Checkout to my branch git checkout ammarfaizi2-dev

  4. Create a copy of my original gwbot.c cp src/gwbot/gwbot.c gwbot.c.bak

  5. Checkout back to your branch git checkout aliwoto-dev

  6. Delete changed gwbot.c rm -v src/gwbot/gwbot.c

  7. Restore gwbot.c cp -v gwbot.c.bak src/gwbot/gwbot.c

ammarfaizi2 commented 3 years ago

Commit Message

Hey! About your commit message, it's incredibly stupid. You're not clean, and I ask you to clean yourself up! They are totally unreadable descriptions. You should try to compare the quality of your commit message with the Linux kernel git logs or some other projects, and cry yourself to sleep.

You might think, "why would I need to take time to think a good commit message? it's wasting my time".

Writing good commit message is a good discipline. At first, any discipline feels slower. Because when you are exercising a discipline, you are stepping through the discipline one step at a time. But it speeds you (or team) up at the end. If you're not clean, you will get slowed down at some point because you and other contributors will be dealing with your dirtiness. Good project can be timeless, don't be in hurry in doing things.

For example, short commit should be at least like this: https://github.com/torvalds/linux/commit/64395d950bc476106b39341e42ebfd4d2eb71d2c

Long commit message can be like this: https://github.com/torvalds/linux/commit/5be28c8f85ce99ed2d329d2ad8bdd18ea19473a5

Fix for this

You need to use git rebase, so let's implement git rebase in real world application, I know you never used git rebase in your life, so try it. I can tolerate other commits message at the moment, but no with those last 2 commits which contains only dots.

Steps

  1. Drink a glass of water so you don't get dehydrated (keep your body healthy, it's important).
  2. git log (see the commit messages, and take one below commit before your dirty commit). So you can take start point at 6fc2bec54d7441a112abd44daf312211933c5c1a, it's called commit hash (copy it, but copy it from your git log, so you can learn how to do it, don't copy the hash from this comment).
  3. git rebase -i <your-commit-hash> (start rebasing, it will open a text editor)
  4. You will see something like this:
    
    pick 20522fd ...
    pick 76e35ae ...

some comment from git here (ignore it)

4. Change the `pick` to `reword` (you can also use `r`, it's the same as `reword`), should look like this:

r 20522fd ... r 76e35ae ...

some comment from git here (ignore it)


5. Save the change and close your text editor.
6. It will open another text editor once you close it.
7. Edit your commit message, give it descriptive name, save it, and close your text editor.
8. `git push -vf` (-vf means verbose and force, you need to force because it changes the old history commit).
ammarfaizi2 commented 3 years ago

Ok, STOP, STOP, STOP!

You don't understand what problem you are having right now. I don't want you to continue this sh*t! You didn't fully address my important comments at all.

I'm not going to pull anything from you until everything gets fixed.

There is no way to continue, it won't fit the need. Because it is pure and utter SHI*T.

We should destroy this before it goes too far, and we need to really implement TDD, so you don't go outside of the scope and need.

Please wait for it, I will make unit test for you.

ammarfaizi2 commented 3 years ago

Really, please wait for me to make unit test for you, it's very cool and clean (just follow me, ok?).

So, what can you do while I am writing unit test for you? You can do anything you want (not must related to this project), so you take a break until the unit test is finished.

I will finish it tomorrow (if I get the time), stay tuned.

ammarfaizi2 commented 3 years ago

Fortunately, I asked to you to push earlier, if not, how far would you go? That would be too far.