Merge branch 'jk/unwanted-advices'
authorJunio C Hamano <gitster@pobox.com>
Sun, 13 Sep 2009 08:33:18 +0000 (01:33 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 13 Sep 2009 08:33:18 +0000 (01:33 -0700)
* jk/unwanted-advices:
status: make "how to stage" messages optional
push: make non-fast-forward help message configurable

1  2 
Makefile
cache.h
config.c
diff --combined Makefile
index 01eea770d3dc977403ff7630510c343ddc29e422,9d9ff45fb24a5669a5b41e7078ecd8640043e65b..d4958b832a29412d0bc3656e98f0e8a2079fe492
+++ b/Makefile
@@@ -91,9 -91,7 +91,9 @@@ all:
  # Define PPC_SHA1 environment variable when running make to make use of
  # a bundled SHA1 routine optimized for PowerPC.
  #
 -# Define NEEDS_SSL_WITH_CRYPTO if you need -lcrypto with -lssl (Darwin).
 +# Define NEEDS_CRYPTO_WITH_SSL if you need -lcrypto when using -lssl (Darwin).
 +#
 +# Define NEEDS_SSL_WITH_CRYPTO if you need -lssl when using -lcrypto (Darwin).
  #
  # Define NEEDS_LIBICONV if linking with libc is not enough (Darwin).
  #
@@@ -380,8 -378,7 +380,8 @@@ BUILT_INS += git-stage$
  BUILT_INS += git-status$X
  BUILT_INS += git-whatchanged$X
  
 -# what 'all' will build and 'install' will install, in gitexecdir
 +# what 'all' will build and 'install' will install in gitexecdir,
 +# excluding programs for built-in commands
  ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
  
  # what 'all' will build but not install in gitexecdir
@@@ -400,6 -397,7 +400,7 @@@ export PERL_PAT
  LIB_FILE=libgit.a
  XDIFF_LIB=xdiff/lib.a
  
+ LIB_H += advice.h
  LIB_H += archive.h
  LIB_H += attr.h
  LIB_H += blob.h
@@@ -457,6 -455,7 +458,7 @@@ LIB_H += utf8.
  LIB_H += wt-status.h
  
  LIB_OBJS += abspath.o
+ LIB_OBJS += advice.o
  LIB_OBJS += alias.o
  LIB_OBJS += alloc.o
  LIB_OBJS += archive.o
@@@ -548,7 -547,6 +550,7 @@@ LIB_OBJS += symlinks.
  LIB_OBJS += tag.o
  LIB_OBJS += trace.o
  LIB_OBJS += transport.o
 +LIB_OBJS += transport-helper.o
  LIB_OBJS += tree-diff.o
  LIB_OBJS += tree.o
  LIB_OBJS += tree-walk.o
@@@ -708,7 -706,6 +710,7 @@@ ifeq ($(uname_S),SCO_SV
        TAR = gtar
  endif
  ifeq ($(uname_S),Darwin)
 +      NEEDS_CRYPTO_WITH_SSL = YesPlease
        NEEDS_SSL_WITH_CRYPTO = YesPlease
        NEEDS_LIBICONV = YesPlease
        ifeq ($(shell expr "$(uname_R)" : '[15678]\.'),2)
@@@ -975,7 -972,9 +977,7 @@@ els
        else
                CURL_LIBCURL = -lcurl
        endif
 -      BUILTIN_OBJS += builtin-http-fetch.o
 -      EXTLIBS += $(CURL_LIBCURL)
 -      LIB_OBJS += http.o http-walker.o
 +      PROGRAMS += git-remote-curl$X git-http-fetch$X
        curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)
        ifeq "$(curl_check)" "070908"
                ifndef NO_EXPAT
@@@ -1010,9 -1009,6 +1012,9 @@@ ifndef NO_OPENSS
        else
                OPENSSL_LINK =
        endif
 +      ifdef NEEDS_CRYPTO_WITH_SSL
 +              OPENSSL_LINK += -lcrypto
 +      endif
  else
        BASIC_CFLAGS += -DNO_OPENSSL
        BLK_SHA1 = 1
@@@ -1249,7 -1245,6 +1251,7 @@@ ifndef 
        QUIET_LINK     = @echo '   ' LINK $@;
        QUIET_BUILT_IN = @echo '   ' BUILTIN $@;
        QUIET_GEN      = @echo '   ' GEN $@;
 +      QUIET_LNCP     = @echo '   ' LN/CP $@;
        QUIET_SUBDIR0  = +@subdir=
        QUIET_SUBDIR1  = ;$(NO_SUBDIR) echo '   ' SUBDIR $$subdir; \
                         $(MAKE) $(PRINT_DIR) -C $$subdir
@@@ -1477,21 -1472,12 +1479,21 @@@ git-imap-send$X: imap-send.o $(GITLIBS
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
                $(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL)
  
 -http.o http-walker.o http-push.o transport.o: http.h
 +http.o http-walker.o http-push.o: http.h
  
 +http.o http-walker.o: $(LIB_H)
 +
 +git-http-fetch$X: revision.o http.o http-walker.o http-fetch.o $(GITLIBS)
 +      $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
 +              $(LIBS) $(CURL_LIBCURL)
  git-http-push$X: revision.o http.o http-push.o $(GITLIBS)
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
                $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
  
 +git-remote-curl$X: remote-curl.o http.o http-walker.o $(GITLIBS)
 +      $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
 +              $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
 +
  $(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
  $(patsubst git-%$X,%.o,$(PROGRAMS)) git.o: $(LIB_H) $(wildcard */*.h)
  builtin-revert.o wt-status.o: wt-status.h
diff --combined cache.h
index 1668f284f68ad3bdb0af56003b46c67fb2fd6b29,e1ab09292ff3b54fcb3c548ee82e084d9eb34b61..1a6412dfd65e6a2cc733f07a335d8b6b88b4264e
+++ b/cache.h
@@@ -4,6 -4,7 +4,7 @@@
  #include "git-compat-util.h"
  #include "strbuf.h"
  #include "hash.h"
+ #include "advice.h"
  
  #include SHA1_HEADER
  #ifndef git_SHA_CTX
@@@ -923,19 -924,13 +924,19 @@@ extern const char *git_mailmap_file
  extern void maybe_flush_or_die(FILE *, const char *);
  extern int copy_fd(int ifd, int ofd);
  extern int copy_file(const char *dst, const char *src, int mode);
 -extern ssize_t read_in_full(int fd, void *buf, size_t count);
 -extern ssize_t write_in_full(int fd, const void *buf, size_t count);
 +extern int copy_file_with_time(const char *dst, const char *src, int mode);
  extern void write_or_die(int fd, const void *buf, size_t count);
  extern int write_or_whine(int fd, const void *buf, size_t count, const char *msg);
  extern int write_or_whine_pipe(int fd, const void *buf, size_t count, const char *msg);
  extern void fsync_or_die(int fd, const char *);
  
 +extern ssize_t read_in_full(int fd, void *buf, size_t count);
 +extern ssize_t write_in_full(int fd, const void *buf, size_t count);
 +static inline ssize_t write_str_in_full(int fd, const char *str)
 +{
 +      return write_in_full(fd, str, strlen(str));
 +}
 +
  /* pager.c */
  extern void setup_pager(void);
  extern const char *pager_program;
diff --combined config.c
index bf122202a014160321d97444a9b3bf2b546f6f3f,f21530cdbd653a21d805550aedf6e69430d1e95b..c64406113686e8886c0719206ce57d73fee13b29
+++ b/config.c
@@@ -627,6 -627,9 +627,9 @@@ int git_default_config(const char *var
        if (!prefixcmp(var, "mailmap."))
                return git_default_mailmap_config(var, value);
  
+       if (!prefixcmp(var, "advice."))
+               return git_default_advice_config(var, value);
        if (!strcmp(var, "pager.color") || !strcmp(var, "color.pager")) {
                pager_use_color = git_config_bool(var,value);
                return 0;
@@@ -1116,7 -1119,7 +1119,7 @@@ int git_config_set_multivar(const char 
                                    copy_end - copy_begin)
                                        goto write_err_out;
                                if (new_line &&
 -                                  write_in_full(fd, "\n", 1) != 1)
 +                                  write_str_in_full(fd, "\n") != 1)
                                        goto write_err_out;
                        }
                        copy_begin = store.offset[i];