Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6952165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:18:50+00:00 2026-05-27T14:18:50+00:00

I think I’m missing something. I was under the impression that git’s usage of

  • 0

I think I’m missing something. I was under the impression that git’s usage of a SHA-1 hash commit identifier meant that one could be certain that patch obtained from someone else for that commit had not been altered.

Take this test I did on my machine (name and email changed, obviously):

cd dogcatcher
dogcatcher> git log
commit 926f347567a9da6f7692aca0e23d13f094d9e3a6
Author: Joe User <joe@test.com>
Date:   Sat Dec 17 15:28:55 2011 -0600

    3rd branch commit

commit 11e8055aa5e8f0d323c48b4f691adced7a8a9762
Author: Joe User <joe@test.com>
Date:   Sat Dec 17 15:10:44 2011 -0600

    second branch commit

commit 23deb7093a8565479092ef84142a0e2e7282d213
Author: Joe User <joe@test.com>

dogcatcher> git format-patch 23de  (format a patch containing everything since 23de)

dogcatcher> cd ..
~> cp -r dogcatcher catcatcher
cd catcatcher

catcatcher> git reset --hard 23de  (reset HEAD to 23de)
catcatcher> git am 00* (apply the two patch files)
catcatcher> git log

commit 2548980811d1875971ce1a018df98374950e0059
Author: Joe User <joe@test.com>
Date:   Sat Dec 17 15:28:55 2011 -0600

    3rd branch commit

commit 7d651d05344ba6e2cd18d8e24c0c350d0c7dec66
Author: Joe User <joe@test.com>
Date:   Sat Dec 17 15:10:44 2011 -0600

    second branch commit

commit 23deb7093a8565479092ef84142a0e2e7282d213
Author: Joe User <joe@test.com>

As you can see, the hashes are different on the last two commits, which were created by the patch. Now, perhaps that makes sense. Certainly the timestamps on the files created by the patch were different. (I’m not sure what set of information is included in the hash)

However, if that’s the case, how can I verify that the patches I just applied contain exactly the same code? How do I know the person that sent me the patch files didn’t make nefarious changes?

Or did I make a mistake that caused the different hash, and had I done it correctly, I would have come out with the same hash?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:18:50+00:00Added an answer on May 27, 2026 at 2:18 pm

    By default, git am sets the Committer Date to the current time. You can use the --committer-date-is-author-date flag to avoid that, though it may still set you as the committer (in fact, it probably will). You can verify this by using git log --format=fuller instead which shows the Committer information as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think that I am misunderstanding something about how jquery $(this) works. In my
I think I got all the steps down but I must be missing something
I think the file that is produced is an .asm file, any idea how
I think that java executables (jar files) are trivial to decompile and get the
I think that I have a quite strange question. I am using a class
Think of the following services on one box: SOCKS proxy HTTP proxy SSH service
Think that I have many activities,and all I want is this: I have a
Think that says it all?
I think I am stupid. I don't understand how Git works with the command
I think There is something wrong in Matlab relative to the number of decimal

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.