guberm / tortoisegit

Automatically exported from code.google.com/p/tortoisegit
0 stars 0 forks source link

When use tortoisegit commit, there is a Set commit date, need a option to set author date and commit date as the same #2184

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is a feature request.
Just try tortoisegit commit along with modify commit date, then view the result,
we will see the author date is old and the commit date is new.

Original issue reported on code.google.com by luoyongg...@gmail.com on 4 May 2014 at 9:48

GoogleCodeExporter commented 9 years ago
Which TortiseGit version are you using?

Original comment by sstrickr...@googlemail.com on 4 May 2014 at 2:55

GoogleCodeExporter commented 9 years ago
The newest one about 1.8.6
2014年5月4日 下午10:55于 <tortoisegit@googlecode.com>写道:

Original comment by luoyongg...@gmail.com on 4 May 2014 at 2:57

GoogleCodeExporter commented 9 years ago
The newest one is 1.8.8.0.

I don't really understand your point. You can set the author date in TGit 
commit dialog.

Why do you need commit and author date to be the same?

Original comment by sstrickr...@googlemail.com on 4 May 2014 at 3:00

GoogleCodeExporter commented 9 years ago
2014年5月4日 下午11:01于 <tortoisegit@googlecode.com>写道:

tortoisegit commit, there is a Set commit date, need a option to set author
date and commit date as the same

commit dialog.

Git has two date, one is author date
The other date is commit date,  commit date always getting ignored but it's
exist . Please search for it.  Commit can only set by environment variable

Original comment by luoyongg...@gmail.com on 4 May 2014 at 3:07

GoogleCodeExporter commented 9 years ago
That doesn't answer the question "Why".

Original comment by sstrickr...@googlemail.com on 4 May 2014 at 3:09

GoogleCodeExporter commented 9 years ago
2014年5月4日 下午11:09于 <tortoisegit@googlecode.com>写道:

tortoisegit commit, there is a Set commit date, need a option to set author
date and commit date as the same

because we want modify the commit date, include both author date and commit
date? This why is obvious cause git has  this feature

Original comment by luoyongg...@gmail.com on 4 May 2014 at 3:13

GoogleCodeExporter commented 9 years ago

Original comment by sstrickr...@googlemail.com on 4 May 2014 at 3:19

GoogleCodeExporter commented 9 years ago
As far as I know,
The Author Date is the time of that commit was made.
The Commit Date is the last time of modification of that commit.
So, if you commit a commit, then Author Date = Commit Date.
If you do Amend or Rebase or other operations of rewrite history, only the 
Commit Date will be changed.

Currently, there is no git command support to set Author Date, but "filter 
branch" does.
if you really want to set Author and Commit Date to the same, try to google 
these keywords:
"filter branch"
"GIT_AUTHOR_DATE"
"GIT_COMMITTER_DATE"

I tried it once.
In my opinion, filter branch is a very dangerous operation.
As Pro Git Book says: The Nuclear Option
(http://git-scm.com/book/en/Git-Tools-Rewriting-History#The-Nuclear-Option:-filt
er-branch)

Original comment by yuelinho...@gmail.com on 5 May 2014 at 2:29

GoogleCodeExporter commented 9 years ago
2014年5月5日 上午10:30于 <tortoisegit@googlecode.com>写道:

commit, there is a Set commit date, need a option to set author date and
commit date as the same

the Commit Date will be changed.

"filter branch" does.

google these keywords:

these two environment variable can used both in filter branch, but also can
be used when commit a  new modification, this means when we commit an old
but not tracked file.

http://git-scm.com/book/en/Git-Tools-Rewriting-History#The-Nuclear-Option:-filte
r-branch
)

Original comment by luoyongg...@gmail.com on 5 May 2014 at 2:33

GoogleCodeExporter commented 9 years ago
The testing CLI:

export GIT_AUTHOR_DATE="Mon May 5 11:00 2014 +0800"
export GIT_COMMITTER_DATE="Mon May 5 11:00 2014 +0800"
git commit -a -m "new commit"
-> both author date and commit date are changed

you are right. It can be used on a new commit. ^_^

----

Other test:

export GIT_AUTHOR_DATE="Mon May 5 11:11 2014 +0800"
export GIT_COMMITTER_DATE="Mon May 5 11:11 2014 +0800"
git commit --amend -m "test amend"
-> *ONLY* commit date is changed.

export GIT_AUTHOR_DATE=""
export GIT_COMMITTER_DATE=""
git commit -a -m "set time env var back to current time"

Original comment by yuelinho...@gmail.com on 5 May 2014 at 4:00