git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Daniel Barkalow <barkalow@iabervon.org>,
	Petr Baudis <pasky@suse.cz>,
	kha@treskal.com, junio@cox.net, git@vger.kernel.org
Subject: Re: [PATCH] Add a birdview-on-the-source-code section to the user manual
Date: Wed, 9 May 2007 22:15:19 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0705092208230.4167@racer.site> (raw)
In-Reply-To: <20070509170725.GB23778@fieldses.org>

Hi,

On Wed, 9 May 2007, J. Bruce Fields wrote:

> On Wed, May 09, 2007 at 06:25:01PM +0200, Johannes Schindelin wrote:
> > None. I only suspected them to be carried out in byte order. From what I 
> > know, there are some shifts involved, which might or might not be helped 
> > by 32-bit arithmetic.
> > 
> > I did not really look into it.
> > 
> > From my prior debugging experiences on Intel, though, I automatically 
> > looked for the least significant bytes at the beginning of those "sha1" 
> > variables, and came up empty.
> 
> So, I'm confused about what you actually mean by "big endian" here.  I
> originally assumed that you meant that SHA1's are defined as bit arrays,
> and that the first bit of the SHA1 is in the high-order bit of the first
> byte.  But if you just meant that the first byte of the SHA1 is stored
> in the first byte of the array...  that kind of goes without saying,
> doesn't it?

Hm.

Let me explain it in this way:

If you parse a number, passed to a program, with strtol(argv[1], NULL, 0) 
you would expect something like this on an Intel processor:

Input 0x1234 -> memory 0x34 0x12 0x00 0x00.

On a big endian machine, you'd expect 0x00 0x00 0x12 0x34.

That is what endianness means.

If you tell Git that it should look for commit e83c6516..., it will store 
the sha1 as 0xe8 0x3c 0x65 0x16 ... in memory, no matter which 
endianness the processor has.

Which was positively confusing for me, since I automatically searched for 
the sequence 0x90 0xf2 0x4a 0x60 ... (which is the tail of that hash).

But if all this sounds too confusing, I agree to delete the 
"(big-endian)".

Ciao,
Dscho

  reply	other threads:[~2007-05-09 20:15 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-08 15:10 [PATCH] Add a birdview-on-the-source-code section to the user manual Johannes Schindelin
2007-05-08 21:01 ` Karl Hasselström
2007-05-08 21:07   ` Johannes Schindelin
2007-05-08 21:31     ` Karl Hasselström
2007-05-08 23:10       ` Johannes Schindelin
2007-05-08 23:22         ` Karl Hasselström
2007-05-09  4:54         ` Daniel Barkalow
2007-05-09  6:31           ` Karl Hasselström
2007-05-09  9:38           ` Johannes Schindelin
2007-05-09 10:43             ` Karl Hasselström
2007-05-09  3:18 ` J. Bruce Fields
2007-05-09  4:06   ` Junio C Hamano
2007-05-09  5:05     ` Junio C Hamano
2007-05-09  9:33       ` Johannes Schindelin
2007-05-09 17:36       ` J. Bruce Fields
2007-05-09  6:48   ` Karl Hasselström
2007-05-09  9:27   ` Johannes Schindelin
2007-05-09 12:19   ` Johannes Schindelin
2007-05-09 12:32     ` Petr Baudis
2007-05-09 12:50       ` Johannes Schindelin
2007-05-09 16:18         ` Daniel Barkalow
2007-05-09 16:25           ` Johannes Schindelin
2007-05-09 17:07             ` J. Bruce Fields
2007-05-09 20:15               ` Johannes Schindelin [this message]
2007-05-09 20:32                 ` J. Bruce Fields
2007-05-09 20:45                 ` Daniel Barkalow
2007-05-09 22:23                   ` Johannes Schindelin
2007-05-10 20:01                     ` Karl Hasselström
2007-05-09 13:18     ` J. Bruce Fields
2007-05-10  4:15       ` Junio C Hamano
2007-05-10 10:36         ` Johannes Schindelin
2007-05-10 20:42           ` Junio C Hamano
2007-05-10 21:14             ` Karl Hasselström

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0705092208230.4167@racer.site \
    --to=johannes.schindelin@gmx.de \
    --cc=barkalow@iabervon.org \
    --cc=bfields@fieldses.org \
    --cc=git@vger.kernel.org \
    --cc=junio@cox.net \
    --cc=kha@treskal.com \
    --cc=pasky@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).