git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [WIP PATCH 00/26] Git setup cleanup series
@ 2010-02-16 16:04 Nguyễn Thái Ngọc Duy
  2010-02-16 16:04 ` [WIP PATCH 01/26] rev-parse --git-dir: print relative gitdir correctly Nguyễn Thái Ngọc Duy
                   ` (25 more replies)
  0 siblings, 26 replies; 27+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2010-02-16 16:04 UTC (permalink / raw)
  To: git; +Cc: Nguyễn Thái Ngọc Duy

This is the result of my "Remove .git auto detection from setup_git_env()"
patch [1]. Basically I make git behave differently (and correctly) when
GIT_HARDENED_SETUP=1 to smooth out the migration from the current messy setup
to a less messy setup. Eventually GIT_HARDENED_SETUP should be enabled by
default and the obsolete code removed, but we're far away from that.

Summary of changes:

 - startup_info struct is added to help move up setup_git_directory_gently()
   to run_builtin(), which reduces lots of headache.
 - GIT_HARDENED_SETUP=1 will make git die() whenever setup_git_env() is called
   from anywhere but setup_git_dir*. It also creates lots of segfault because
   get_git_dir() and friends now can return NULL.
 - gitattr, gitexcludes will not access repository if there is no repository
 - enter_repo() will use setup_git_dir* to do the setup
 - because non-builtin commands do not have startup_info, they will behave
   just like before. I'll need to look at them.

Tests are lacking. But you can just try "GIT_HARDENED_SETUP=1 make test"
after 04/26, then again at the end of the series to see the difference.
It'd be great if people see new failing tests. I'm not sure I have caught
them all.

[1] http://mid.gmane.org/1265370468-6147-1-git-send-email-pclouds@gmail.com

Nguyễn Thái Ngọc Duy (26):
  rev-parse --git-dir: print relative gitdir correctly
  setup_git_directory*: Explicitly set git dir
  Save setup_git_dir* info globally for later use
  Add GIT_HARDENED_SETUP to detect gitdir/worktree related mis-setup errors
  enter_repo(): use setup_git_directory_gently internally
  Tweak init/clone to work properly with GIT_HARDENED_SETUP=1
  Support running setup_git_dir_gently() from the beginning for builtin commands
  config: move up gitdir setup to run_builtin()
  hash-object: move gitdir setup to run_builtin()
  shortlog: move up gitdir setup to run_builtin()
  Do not look for .git/info/exclude when gitdir is not set up
  grep: move up gitdir setup to run_builtin()
  USE_PAGER should not be used without RUN_SETUP*
  Do not try to read $GIT_DIR/info/attributes if there is no repository
  archive: move up gitdir setup to run_builtin()
  mailinfo: move up gitdir setup to run_builtin()
  check-ref-format: setup gitdir gently
  verify-pack: set up gitdir gently
  apply: move up gitdir setup to run_builtin()
  bundle: move up gitdir setup to run_builtin()
  diff: move up gitdir setup to run_builtin()
  help: move up gitdir setup to run_builtin()
  ls-remote: move up gitdir setup to run_builtin()
  var: move up gitdir setup to run_builtin()
  merge-file: move up gitdir setup to run_builtin()
  Turn on GIT_HARDENED_SETUP for the whole test suite

 attr.c                  |    5 ++-
 builtin-apply.c         |   13 +++----
 builtin-archive.c       |    2 +-
 builtin-bundle.c        |    6 +--
 builtin-config.c        |   12 +++---
 builtin-diff.c          |    6 +--
 builtin-grep.c          |    9 ++---
 builtin-hash-object.c   |    9 +++--
 builtin-help.c          |    2 -
 builtin-init-db.c       |    4 ++
 builtin-ls-remote.c     |    3 --
 builtin-mailinfo.c      |    3 --
 builtin-merge-file.c    |    4 +--
 builtin-rev-parse.c     |    8 ++++
 builtin-shortlog.c      |    4 +--
 builtin-var.c           |    2 -
 cache.h                 |    8 ++++
 config.c                |   17 ++++++---
 dir.c                   |    8 +++--
 environment.c           |   43 +++++++++++++++++-----
 git.c                   |   88 +++++++++++++++++++++++++++++++----------------
 path.c                  |    8 ++---
 setup.c                 |   48 ++++++++++++++++++++------
 t/t0024-crlf-archive.sh |    1 +
 t/t1302-repo-version.sh |    2 +-
 t/test-lib.sh           |    3 ++
 26 files changed, 204 insertions(+), 114 deletions(-)

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

end of thread, other threads:[~2010-02-16 16:38 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-16 16:04 [WIP PATCH 00/26] Git setup cleanup series Nguyễn Thái Ngọc Duy
2010-02-16 16:04 ` [WIP PATCH 01/26] rev-parse --git-dir: print relative gitdir correctly Nguyễn Thái Ngọc Duy
2010-02-16 16:04 ` [WIP PATCH 02/26] setup_git_directory*: Explicitly set git dir Nguyễn Thái Ngọc Duy
2010-02-16 16:04 ` [WIP PATCH 03/26] Save setup_git_dir* info globally for later use Nguyễn Thái Ngọc Duy
2010-02-16 16:04 ` [WIP PATCH 04/26] Add GIT_HARDENED_SETUP to detect gitdir/worktree related mis-setup errors Nguyễn Thái Ngọc Duy
2010-02-16 16:04 ` [WIP PATCH 05/26] enter_repo(): use setup_git_directory_gently internally Nguyễn Thái Ngọc Duy
2010-02-16 16:04 ` [WIP PATCH 06/26] Tweak init/clone to work properly with GIT_HARDENED_SETUP=1 Nguyễn Thái Ngọc Duy
2010-02-16 16:04 ` [WIP PATCH 07/26] Support running setup_git_dir_gently() from the beginning for builtin commands Nguyễn Thái Ngọc Duy
2010-02-16 16:04 ` [WIP PATCH 08/26] config: move up gitdir setup to run_builtin() Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 09/26] hash-object: move " Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 10/26] shortlog: move up " Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 11/26] Do not look for .git/info/exclude when gitdir is not set up Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 12/26] grep: move up gitdir setup to run_builtin() Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 13/26] USE_PAGER should not be used without RUN_SETUP* Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 14/26] Do not try to read $GIT_DIR/info/attributes if there is no repository Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 15/26] archive: move up gitdir setup to run_builtin() Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 16/26] mailinfo: " Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 17/26] check-ref-format: setup gitdir gently Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 18/26] verify-pack: set up " Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 19/26] apply: move up gitdir setup to run_builtin() Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 20/26] bundle: " Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 21/26] diff: " Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 22/26] help: " Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 23/26] ls-remote: " Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 24/26] var: " Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 25/26] merge-file: " Nguyễn Thái Ngọc Duy
2010-02-16 16:05 ` [WIP PATCH 26/26] Turn on GIT_HARDENED_SETUP for the whole test suite Nguyễn Thái Ngọc Duy

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).