git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Broken adding of cache entries

From
Junio C Hamano <junkio@cox.net>
Date
May 8, 2005, 22:18 UTC
Message-ID
<7v7ji94b1d.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20050508212202.GM9495@pasky.ji.cz>
>>>>> "PB" == Petr Baudis <pasky@ucw.cz> writes:
PB> Still, I'd like to know why the checking in write-tree is necessary.

The following is just a rephrase of what I wrote in my previous message <7vll6q70mg.fsf@assigned-by-dhcp.cox.net>.

------------ test.sh ------------ #!/bin/sh

test="++testdir" rm -fr $test mkdir $test cd $test || exit

show () {
	echo "# ls ($1)"
	ls -F
	echo "# git-ls-files --stage ($1)"
	git-ls-files --stage
	case "$2" in
	'')	;;
	?*)
		echo "# git-ls-tree -r ($1)"
		git-ls-tree -r $2
		;;
	esac
}

echo "# Original" git-init-db date >not-so-interesting git-update-cache --add not-so-interesting original=$(echo Original | git-commit-tree $(git-write-tree)) show Original $original rm -rf path not-so-interesting

echo "# Branch A"
git-read-tree $original
git-checkout-cache -f -a
date >path
git-update-cache --add path
branchA=$(echo Branch A Changes |
          git-commit-tree $(git-write-tree) -p $original)
show 'Branch A' $branchA
rm -rf path not-so-interesting
echo "# Branch B"
git-read-tree $original
git-checkout-cache -f -a
mkdir path
date >path/file
git-update-cache --add path/file
branchB=$(echo Branch B Changes |
          git-commit-tree $(git-write-tree) -p $original)
show 'Branch B' $branchB
rm -rf path not-so-interesting

echo "# Attempt merge O A B" mb=$(git-merge-base $branchA $branchB) echo "Original $original" echo "Branch-A $branchA" echo "Branch-B $branchB" echo "MergeBase $mb"

git-read-tree -m $mb $branchA $branchB show "Merge" ------------ test.out ------------ # Original defaulting to local storage area Committing initial tree 682c2247823f37e4cf64f240009c9ba932b04fe0 # ls (Original) not-so-interesting # git-ls-files --stage (Original) 100644 9bcc8fabbbb587ba312a45b144dce8f4d9191da5 0 not-so-interesting # git-ls-tree -r (Original) 100644 blob 9bcc8fabbbb587ba312a45b144dce8f4d9191da5 not-so-interesting # Branch A # ls (Branch A) not-so-interesting path # git-ls-files --stage (Branch A) 100644 9bcc8fabbbb587ba312a45b144dce8f4d9191da5 0 not-so-interesting 100644 9bcc8fabbbb587ba312a45b144dce8f4d9191da5 0 path # git-ls-tree -r (Branch A) 100644 blob 9bcc8fabbbb587ba312a45b144dce8f4d9191da5 not-so-interesting 100644 blob 9bcc8fabbbb587ba312a45b144dce8f4d9191da5 path # Branch B # ls (Branch B) not-so-interesting path/ # git-ls-files --stage (Branch B) 100644 9bcc8fabbbb587ba312a45b144dce8f4d9191da5 0 not-so-interesting 100644 9bcc8fabbbb587ba312a45b144dce8f4d9191da5 0 path/file # git-ls-tree -r (Branch B) 100644 blob 9bcc8fabbbb587ba312a45b144dce8f4d9191da5 not-so-interesting 040000 tree f4e939c9b65aff9a59118f3f3f299ef30744adfa path 100644 blob 9bcc8fabbbb587ba312a45b144dce8f4d9191da5 path/file # Attempt merge O A B Original 40c1d8a0e79df9e681667e0074664266b6bd9935 Branch-A 88b3e7e4ce0ba55c60fe4de6523968ecabb1cc78 Branch-B 0faa7f6b7f68ce2951fe3f26f937766ee53dc11c MergeBase 40c1d8a0e79df9e681667e0074664266b6bd9935 # ls (Merge) # git-ls-files --stage (Merge) 100644 9bcc8fabbbb587ba312a45b144dce8f4d9191da5 0 not-so-interesting 100644 9bcc8fabbbb587ba312a45b144dce8f4d9191da5 2 path 100644 9bcc8fabbbb587ba312a45b144dce8f4d9191da5 3 path/file

Previous: Petr BaudisNext: Junio C Hamano
Message 11 of 13 in “Broken adding of cache entries”
  1. Petr BaudisMay 7, 2005
  2. Junio C HamanoMay 7, 2005
  3. Junio C HamanoMay 7, 2005
  4. Petr BaudisMay 7, 2005
  5. Junio C HamanoMay 8, 2005
  6. Junio C HamanoMay 8, 2005
  7. Junio C HamanoMay 8, 2005
  8. Petr BaudisMay 8, 2005
  9. Junio C HamanoMay 8, 2005
  10. Petr BaudisMay 8, 2005
  11. Junio C HamanoMay 8, 2005
  12. Junio C HamanoMay 8, 2005
  13. Junio C HamanoMay 8, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.