Merge branch 'mr/worktree-list'
authorJunio C Hamano <gitster@pobox.com>
Mon, 26 Oct 2015 22:55:16 +0000 (15:55 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 26 Oct 2015 22:55:16 +0000 (15:55 -0700)
Add the "list" subcommand to "git worktree".

* mr/worktree-list:
worktree: add 'list' command
worktree: add details to the worktree struct
worktree: add a function to get worktree details
worktree: refactor find_linked_symref function
worktree: add top-level worktree.c

1  2 
Makefile
diff --combined Makefile
index 0d9f5dddbc68e2f7fc2c5c5a2f27f2c30466a32e,f4ee2d223d207c9fd028002fcd5cc238be98eb46..8466333027490a0595c8482b7c1d3df4dac78565
+++ b/Makefile
@@@ -74,6 -74,8 +74,6 @@@ all:
  # Define HAVE_PATHS_H if you have paths.h and want to use the default PATH
  # it specifies.
  #
 -# Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.
 -#
  # Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
  # d_type in struct dirent (Cygwin 1.5, fixed in Cygwin 1.7).
  #
@@@ -373,9 -375,6 +373,9 @@@ ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS
  ALL_LDFLAGS = $(LDFLAGS)
  STRIP ?= strip
  
 +# Create as necessary, replace existing, make ranlib unneeded.
 +ARFLAGS = rcs
 +
  # Among the variables below, these:
  #   gitexecdir
  #   template_dir
@@@ -808,6 -807,7 +808,7 @@@ LIB_OBJS += version.
  LIB_OBJS += versioncmp.o
  LIB_OBJS += walker.o
  LIB_OBJS += wildmatch.o
+ LIB_OBJS += worktree.o
  LIB_OBJS += wrapper.o
  LIB_OBJS += write_or_die.o
  LIB_OBJS += ws.o
@@@ -903,7 -903,6 +904,7 @@@ BUILTIN_OBJS += builtin/shortlog.
  BUILTIN_OBJS += builtin/show-branch.o
  BUILTIN_OBJS += builtin/show-ref.o
  BUILTIN_OBJS += builtin/stripspace.o
 +BUILTIN_OBJS += builtin/submodule--helper.o
  BUILTIN_OBJS += builtin/symbolic-ref.o
  BUILTIN_OBJS += builtin/tag.o
  BUILTIN_OBJS += builtin/unpack-file.o
@@@ -1162,6 -1161,9 +1163,6 @@@ endi
  ifdef NO_D_TYPE_IN_DIRENT
        BASIC_CFLAGS += -DNO_D_TYPE_IN_DIRENT
  endif
 -ifdef NO_D_INO_IN_DIRENT
 -      BASIC_CFLAGS += -DNO_D_INO_IN_DIRENT
 -endif
  ifdef NO_GECOS_IN_PWENT
        BASIC_CFLAGS += -DNO_GECOS_IN_PWENT
  endif
@@@ -1464,13 -1466,13 +1465,13 @@@ endi
  QUIET_SUBDIR0  = +$(MAKE) -C # space to separate -C and subdir
  QUIET_SUBDIR1  =
  
 -ifneq ($(findstring $(MAKEFLAGS),w),w)
 +ifneq ($(findstring w,$(MAKEFLAGS)),w)
  PRINT_DIR = --no-print-directory
  else # "make -w"
  NO_SUBDIR = :
  endif
  
 -ifneq ($(findstring $(MAKEFLAGS),s),s)
 +ifneq ($(findstring s,$(MAKEFLAGS)),s)
  ifndef V
        QUIET_CC       = @echo '   ' CC $@;
        QUIET_AR       = @echo '   ' AR $@;
@@@ -1994,13 -1996,13 +1995,13 @@@ $(REMOTE_CURL_PRIMARY): remote-curl.o h
                $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
  
  $(LIB_FILE): $(LIB_OBJS)
 -      $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $^
 +      $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
  
  $(XDIFF_LIB): $(XDIFF_OBJS)
 -      $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $^
 +      $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
  
  $(VCSSVN_LIB): $(VCSSVN_OBJS)
 -      $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $^
 +      $(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
  
  export DEFAULT_EDITOR DEFAULT_PAGER