git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* bug: --shallow-since misbehaves on old branch heads
@ 2018-05-22 19:48 Andreas Krey
  2018-05-23 16:02 ` Duy Nguyen
  2018-05-26 11:35 ` [PATCH] upload-pack: reject shallow requests that would return nothing Nguyễn Thái Ngọc Duy
  0 siblings, 2 replies; 8+ messages in thread
From: Andreas Krey @ 2018-05-22 19:48 UTC (permalink / raw)
  To: git

Hi everybody,

I think I have discovered a problem with clone/fetch --shallow-since:
When a ref that is fetches has a head that is already older than
the 'since' time, then the entire branch is fetched, instead of
just the current commit.

Repro:

  rm -rf tmp out deep
  git init tmp
  for i in `seq 10 31`; do
      d="2017-05-${i}T12:00"
      GIT_AUTOR_DATE="$d" GIT_COMMITTER_DATE="$d" git -C tmp commit -m nix$i --allow-empty
  done
  git -C tmp checkout -b test HEAD^^^
  for i in `seq 10 14`; do
      d="2017-06-${i}T12:00"
      GIT_AUTHOR_DATE="$d" GIT_COMMITTER_DATE="$d" git -C tmp commit -m nax$i --allow-empty
  done
  for i in `seq 1 4`; do
      git -C tmp commit -m new$i --allow-empty
  done

  echo "** This is fine:"

  git clone --shallow-since '1 month ago' file://`pwd`/tmp out --branch test
  git -C out log --oneline

  echo "** This should show one commit but shows all:"

  git clone --shallow-since '1 month ago' file://`pwd`/tmp deep --branch master
  git -C deep log --oneline

Do I expect the wrong thing?

- Andreas


-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-06-04 14:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-22 19:48 bug: --shallow-since misbehaves on old branch heads Andreas Krey
2018-05-23 16:02 ` Duy Nguyen
2018-05-26 11:35 ` [PATCH] upload-pack: reject shallow requests that would return nothing Nguyễn Thái Ngọc Duy
2018-05-28  5:55   ` Junio C Hamano
2018-05-28 18:48     ` Duy Nguyen
2018-06-02  6:06       ` Duy Nguyen
2018-06-04 10:46   ` Junio C Hamano
2018-06-04 14:44     ` Duy Nguyen

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).