Gittyup icon indicating copy to clipboard operation
Gittyup copied to clipboard

Ability to change dates in amend

Open H-4ND-H opened this issue 2 years ago • 18 comments

Add the functionality to edit author and/or committer dates in amend.(#277)

User can choose to edit the times manually or leave it to be filled with current time as before.

As a point to have in mind, maybe we can improve the code by providing format check for input fields, not just date but for example email field also.

Please provide feedback if any thing can be improved.

H-4ND-H avatar Sep 27 '22 06:09 H-4ND-H

As a point to have in mind, maybe we can improve the code by providing format check for input fields, not just date but for example email field also.

would you like to check if it is a valid email, like contains @ and . at the end?

Murmele avatar Sep 27 '22 07:09 Murmele

How about using a QDateTimeEdit?

exactly-one-kas avatar Sep 27 '22 07:09 exactly-one-kas

@H-4ND-H in the repo you find a cl-fmt.sh shell script. Run this to format the code

Murmele avatar Sep 27 '22 07:09 Murmele

How about using a QDateTimeEdit?

maybe a good idea, so the user cannot create a wrong date

Murmele avatar Sep 27 '22 07:09 Murmele

As a point to have in mind, maybe we can improve the code by providing format check for input fields, not just date but for example email field also.

would you like to check if it is a valid email, like contains @ and . at the end?

If its a good idea we can throw in some regex, but on the other side if git does not care, why should we?

H-4ND-H avatar Sep 27 '22 07:09 H-4ND-H

How about using a QDateTimeEdit?

maybe a good idea, so the user cannot create a wrong date

I'm not a QWidget guy, so that seems nice, will edit the code and push.

H-4ND-H avatar Sep 27 '22 07:09 H-4ND-H

If its a good idea we can throw in some regex, but on the other side if git does not care, why should we?

I'll second this, especially considering the email validation cannot be done according to the RFC with regexes and the regexes tend to be huge

exactly-one-kas avatar Sep 27 '22 07:09 exactly-one-kas

@H-4ND-H in the repo you find a cl-fmt.sh shell script. Run this to format the code

I use clang-format-16, but it also changed some other files in project which I did not touch, for the moment, i did not push those files, but the files I've changed only.

H-4ND-H avatar Sep 27 '22 09:09 H-4ND-H

It formats also the zip dependency. Those you can ignore ^^ Formatting looks good

Murmele avatar Sep 27 '22 09:09 Murmele

Before amending grafik After amending grafik

Something is not yet correctly with the date

Murmele avatar Sep 27 '22 12:09 Murmele

Before amending grafik After amending grafik

Something is not yet correctly with the date

  • When I build the branch on linux I am not able to reproduce.
  • On Windows with the artifact this problem happens
  • On linux with the flatpak I am able to reproduce this issue too

Murmele avatar Sep 27 '22 16:09 Murmele

@H-4ND-H I think I fixed the problem: https://github.com/exactly-one-kas/Gittyup/commit/94c7f81d0059cf5d90ee577cd9272db1bae316bd

@Murmele Are you talking about not being able to use the comitter date checkbox or the top right not showing the time in the current timezone?

exactly-one-kas avatar Sep 27 '22 18:09 exactly-one-kas

tnx, that was a silly mistake, sorry

H-4ND-H avatar Sep 27 '22 19:09 H-4ND-H

Don't worry, silly mistakes are my bread and butter - I spent 2 hours looking for that error lol

exactly-one-kas avatar Sep 27 '22 19:09 exactly-one-kas

@H-4ND-H I think I fixed the problem: exactly-one-kas@94c7f81

@Murmele Are you talking about not being able to use the comitter date checkbox or the top right not showing the time in the current timezone?

Its not just the timezone. I can change the year wathever i want but it does not change. But is reproducable only in the artifacts not whe I build it from source

Murmele avatar Sep 27 '22 19:09 Murmele

@H-4ND-H I think I fixed the problem: https://github.com/exactly-one-kas/Gittyup/commit/94c7f81d0059cf5d90ee577cd9272db1bae316bd

Sorry for newbie question, about the work flow, now that you have changed the code, shall I merge it into my own fork for the build system to detect changes, or you make a new PR?

H-4ND-H avatar Sep 28 '22 05:09 H-4ND-H

Until now we are pushing most of the time directly to the PR. So kas would push to your branch directly. If you would like to have the changes now wether you merge or just cherry pick the commit. Only the master branch is protected. There we cannot push directly only by a merge request.

Murmele avatar Sep 28 '22 05:09 Murmele

@H-4ND-H You can either enable maintainer edits image

or you can pull in my change by merging or resetting your branch to my commit

exactly-one-kas avatar Sep 28 '22 07:09 exactly-one-kas

@H-4ND-H Do you have feedback on this?

exactly-one-kas avatar Oct 04 '22 10:10 exactly-one-kas

@H-4ND-H I rebased the amend branch to solve the conflicts to master there

Murmele avatar Oct 04 '22 11:10 Murmele

@exactly-one-kas do you see also this issue?

Murmele avatar Oct 04 '22 11:10 Murmele

@H-4ND-H Do you have feedback on this?

Your changes seem fine to me, and the push access to my repo was enabled by default, so I was waiting for your push

H-4ND-H avatar Oct 04 '22 11:10 H-4ND-H

@Murmele which issue?

@H-4ND-H image

How about we just merge this PR and I'll push onto @Murmele's branch?

exactly-one-kas avatar Oct 04 '22 12:10 exactly-one-kas

@Murmele which issue?

@H-4ND-H image

How about we just merge this PR and I'll push onto @Murmele's branch?

The checkbox u mentioned earlier is checked, so I'll search if I shall take extra measures, in the meanwhile I'll update my branch with your changes.

H-4ND-H avatar Oct 04 '22 12:10 H-4ND-H

The checkbox should be enough, I don't know why it doesn't work

in the meanwhile I'll update my branch with your changes

Please do

exactly-one-kas avatar Oct 04 '22 12:10 exactly-one-kas

@H-4ND-H I think I fixed the problem: exactly-one-kas@94c7f81 @Murmele Are you talking about not being able to use the comitter date checkbox or the top right not showing the time in the current timezone?

Its not just the timezone. I can change the year wathever i want but it does not change. But is reproducable only in the artifacts not whe I build it from source

This

Murmele avatar Oct 04 '22 13:10 Murmele

Yes, this is the bug I fixed with my changes

exactly-one-kas avatar Oct 04 '22 13:10 exactly-one-kas

Ah ok thanks for the explanation :)

Murmele avatar Oct 04 '22 13:10 Murmele

Please do

Done

H-4ND-H avatar Oct 04 '22 15:10 H-4ND-H

This needs to be rebased on top of the current upstream Amend branch, if you want, I can do it for you

exactly-one-kas avatar Oct 04 '22 17:10 exactly-one-kas