1. 11 10月, 2012 1 次提交
  2. 20 9月, 2012 1 次提交
  3. 18 9月, 2012 1 次提交
  4. 13 9月, 2012 1 次提交
    • M
      string_list: add two new functions for splitting strings · ff919f96
      Michael Haggerty 提交于
      Add two new functions, string_list_split() and
      string_list_split_in_place().  These split a string into a string_list
      on a separator character.  The first makes copies of the substrings
      (leaving the input string untouched) and the second splits the
      original string in place, overwriting the separator characters with
      NULs and referring to the original string's memory.
      
      These functions are similar to the strbuf_split_*() functions except
      that they work with the more powerful string_list interface.
      Signed-off-by: NMichael Haggerty <mhagger@alum.mit.edu>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      ff919f96
  5. 09 9月, 2012 2 次提交
  6. 03 9月, 2012 1 次提交
  7. 09 8月, 2012 6 次提交
  8. 07 8月, 2012 2 次提交
  9. 28 7月, 2012 1 次提交
  10. 26 7月, 2012 1 次提交
  11. 24 7月, 2012 1 次提交
    • J
      Makefile: BLK_SHA1 does not require fast htonl() and unaligned loads · f200197c
      Jonathan Nieder 提交于
      block-sha1/ is fast on most known platforms.  Clarify the Makefile to
      be less misleading about that.
      
      Early versions of block-sha1/ explicitly relied on fast htonl() and
      fast 32-bit loads with arbitrary alignment.  Now it uses those on some
      arches but the default behavior is byte-at-a-time access for the sake
      of arches like ARM, Alpha, and their kin and it is still pretty fast
      on these arches (fast enough to supersede the mozilla SHA1
      implementation and the hand-written ARM assembler implementation that
      were bundled before).
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f200197c
  12. 23 7月, 2012 1 次提交
  13. 20 7月, 2012 2 次提交
    • S
      build: reconfigure automatically if configure.ac changes · 8242ff47
      Stefano Lattarini 提交于
      This provides a reduced but still useful sibling of the Automake's
      "automatic Makefile rebuild" feature.  It's important to note that
      we take care to enable the new rules only if the tree that has already
      be configured with './configure', so that users relying on manual
      configuration won't be negatively impacted.
      Signed-off-by: NStefano Lattarini <stefano.lattarini@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8242ff47
    • S
      build: "make clean" should not remove configure-generated files · dc7ace5f
      Stefano Lattarini 提交于
      Those filed hold variables, settings and information set by the
      configuration process run by './configure'; in Autotools-based
      build system that kind of stuff should only be removed by
      "make distclean".  Having it removed by "make clean" is not only
      inconsistent, but causes real confusion for that part of the Git
      audience that is used to the Autotools semantics; for example,
      an autotools old-timer that has run:
      
          ./configure --prefix /opt/git
      
      in the past, without running "make distclean" afterwards, would
      expect a "make install" issued after a "make clean" to rebuild and
      install git in '/opt/git'; but with the current behaviour, the
      "make clean" invocation removes (among the other things) the file
      'config.mak.autogen', so that the "make install" falls back to the
      default prefix of '$HOME', thus installing git in the user's home
      directory -- definitely unexpected.
      Signed-off-by: NStefano Lattarini <stefano.lattarini@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      dc7ace5f
  14. 09 7月, 2012 13 次提交
    • J
      Makefile: document ground rules for target-specific dependencies · 7b63c77e
      Jonathan Nieder 提交于
      When a source file makes use of a makefile variable, there should be a
      corresponding dependency on a file that changes when that variable
      changes to ensure the build output is not left stale when the variable
      changes.
      
      Document this, even though we are not following the rule perfectly
      yet.  Based on an explanation from Jeff King.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7b63c77e
    • J
      Makefile: move GIT-VERSION-FILE dependencies closer to use · 520a6cdc
      Jeff King 提交于
      There is a list of all of the targets which depend on
      GIT-VERSION-FILE, but it can be quite far from the actual
      point where the targets actually use $(GIT_VERSION). This
      can make it hard to verify that each use of $(GIT_VERSION)
      has a matching dependency.
      
      This patch moves the dependency closer to the actual build
      instructions, which makes verification easier.  This also
      fixes the generation of "configure", which did not properly
      mark the dependency.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      520a6cdc
    • J
      Makefile: build instaweb similar to other scripts · b5295f32
      Jeff King 提交于
      Instaweb would not properly rebuild if the build-time
      parameters changed. Fix this by depending on the
      GIT-SCRIPT-DEFINES meta-file and using $(cmd_munge_script)
      like all the other shell scripts. This requires adding a few
      new parametres to cmd_munge_script, but that doesn't hurt
      existing scripts.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b5295f32
    • J
      Makefile: update scripts when build-time parameters change · e4dd89ab
      Jeff King 提交于
      Currently, running:
      
        make SHELL_PATH=/bin/bash &&
        make SHELL_PATH=/bin/sh
      
      will not rebuild any shell scripts in the second command,
      leading to incorrect results when building from an unclean
      working directory.
      
      This patch introduces a new dependency meta-file to notice
      the change.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e4dd89ab
    • J
      Makefile: do not replace @@GIT_VERSION@@ in shell scripts · 2b9391bc
      Jeff King 提交于
      No shell script actually uses the replacement (it is used in
      some perl scripts, but cmd_munge_script only handles shell
      scripts). We can also therefore drop the dependency on
      GIT-VERSION-FILE.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2b9391bc
    • J
      Makefile: split prefix flags from GIT-CFLAGS · be1dbd0a
      Jeff King 提交于
      Most of the build targets do not care about the setting of
      $prefix (or its derivative variables), but will be rebuilt
      if the prefix changes. For most setups this doesn't matter
      (they set prefix once and never change it), but for a setup
      which puts each branch or version in its own prefix, this
      unnecessarily causes a full rebuild whenever the branc is
      changed.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      be1dbd0a
    • J
      Makefile: be silent when only GIT_USER_AGENT changes · 33ddbcb0
      Jonathan Nieder 提交于
      To avoid noise during builds, unlike the GIT-CFLAGS rule which prints
      "* new build flags or prefix" so the operator knows why all files are
      being rebuilt when it changes, GIT-USER-AGENT generation is silent.
      
      If this code breaks and a target depending on GIT-USER-AGENT ends up
      being rebuilt when it shouldn't be, the full dependency chain can be
      retrieved with "make --debug=b".
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      33ddbcb0
    • J
      Makefile: split GIT_USER_AGENT from GIT-CFLAGS · 620c293a
      Jeff King 提交于
      The default user-agent depends on the GIT_VERSION, which
      means that anytime you switch versions, it causes a full
      rebuild. Instead, let's split it out into its own file and
      restrict the dependency to version.o.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      620c293a
    • J
      Makefile: do not replace @@GIT_USER_AGENT@@ in scripts · 47eb28ec
      Jeff King 提交于
      No scripts actually care about this replacement. This was
      erroneously added by 42dcbb73 (version: add git_user_agent function,
      2012-06-02).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      47eb28ec
    • J
      Makefile: apply dependencies consistently to sparse/asm targets · c0219dd5
      Jeff King 提交于
      When a C file "foo.c" depends on a generated header file, we
      note the dependency for the "foo.o" target. However, we
      should also note it for other targets that are built from
      foo.c, like "foo.sp" and "foo.s". These tend to be missed
      because the latter two are not part of the default build,
      and are typically built after a regular build which will
      generate the header.  Let's be consistent about including
      them in dependencies.
      
      This also makes us more consistent with nearby lines which
      tack on EXTRA_CPPFLAGS when building certain files.  These
      flags may sometimes require extra dependencies to be added
      (e.g., like GIT-VERSION-FILE; this is not the case for any
      of the updated lines in this patch, but it is establishing a
      style that will be used in later patches). Technically the
      ".sp" and ".s" targets do not care about these dependencies,
      because they are force-built (".sp" because it is a phony
      target, and ".s" because we explicitly force a rebuild).
      
      Since the blocks in question are about communicating "things
      built from foo.c depend on these flags", it frees the reader
      from having to know or care more about how those targets are
      implemented, and why it is OK for only "foo.o" to depend on
      GIT-VERSION-FILE while "foo.sp" and "foo.s" both are
      impacted by $(GIT_VERSION). And it helps future-proof us if
      those force-build details should ever change.
      
      This patch explicitly does not update the static header
      dependencies used when COMPUTED_HEADER_DEPENDENCIES is off.
      They are similar to the GIT-VERSION-FILE case above, in that
      technically "foo.s" would depend on its included headers,
      but it is irrelevant because we force-build it anyway. So it
      would be tempting to update them in the same way (for
      readability and future-proofing). However, those rules are
      meant as a fallback to the computed header dependencies,
      which do not handle ".s" and ".sp" at all (and are a much
      harder problem to solve, as gcc is the one generating those
      dependency lists).
      
      So let's leave that harder problem until (and if) somebody
      wants to change the ".sp" and ".s" rules, and keep the
      static header dependencies consistent with the computed
      ones.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c0219dd5
    • J
      Makefile: do not have git.o depend on common-cmds.h · eea8c32b
      Jeff King 提交于
      This dependency has been stale since 70827b15 (Split up
      builtin commands into separate files from git.c, 2006-04-21).
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      eea8c32b
    • J
      Makefile: fold XDIFF_H and VCSSVN_H into LIB_H · 60d24dd2
      Jonathan Nieder 提交于
      Just like MISC_H (see previous commit), there is no reason to track
      xdiff and vcs-svn headers separately from the rest of the headers.
      The only purpose of these variables is to keep track of recompilation
      dependencies.
      
      As a pleasant side effect, folding these into LIB_H lets us stop
      tracking GIT_OBJS and VCSSVN_TEST_OBJS separately from the list of all
      OBJECTS.
      Signed-off-by: NJonathan Nieder <jrnieder@gmail.com>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      60d24dd2
    • T
      git on Mac OS and precomposed unicode · 76759c7d
      Torsten Bögershausen 提交于
      Mac OS X mangles file names containing unicode on file systems HFS+,
      VFAT or SAMBA.  When a file using unicode code points outside ASCII
      is created on a HFS+ drive, the file name is converted into
      decomposed unicode and written to disk. No conversion is done if
      the file name is already decomposed unicode.
      
      Calling open("\xc3\x84", ...) with a precomposed "Ä" yields the same
      result as open("\x41\xcc\x88",...) with a decomposed "Ä".
      
      As a consequence, readdir() returns the file names in decomposed
      unicode, even if the user expects precomposed unicode.  Unlike on
      HFS+, Mac OS X stores files on a VFAT drive (e.g. an USB drive) in
      precomposed unicode, but readdir() still returns file names in
      decomposed unicode.  When a git repository is stored on a network
      share using SAMBA, file names are send over the wire and written to
      disk on the remote system in precomposed unicode, but Mac OS X
      readdir() returns decomposed unicode to be compatible with its
      behaviour on HFS+ and VFAT.
      
      The unicode decomposition causes many problems:
      
      - The names "git add" and other commands get from the end user may
        often be precomposed form (the decomposed form is not easily input
        from the keyboard), but when the commands read from the filesystem
        to see what it is going to update the index with already is on the
        filesystem, readdir() will give decomposed form, which is different.
      
      - Similarly "git log", "git mv" and all other commands that need to
        compare pathnames found on the command line (often but not always
        precomposed form; a command line input resulting from globbing may
        be in decomposed) with pathnames found in the tree objects (should
        be precomposed form to be compatible with other systems and for
        consistency in general).
      
      - The same for names stored in the index, which should be
        precomposed, that may need to be compared with the names read from
        readdir().
      
      NFS mounted from Linux is fully transparent and does not suffer from
      the above.
      
      As Mac OS X treats precomposed and decomposed file names as equal,
      we can
      
       - wrap readdir() on Mac OS X to return the precomposed form, and
      
       - normalize decomposed form given from the command line also to the
         precomposed form,
      
      to ensure that all pathnames used in Git are always in the
      precomposed form.  This behaviour can be requested by setting
      "core.precomposedunicode" configuration variable to true.
      
      The code in compat/precomposed_utf8.c implements basically 4 new
      functions: precomposed_utf8_opendir(), precomposed_utf8_readdir(),
      precomposed_utf8_closedir() and precompose_argv().  The first three
      are to wrap opendir(3), readdir(3), and closedir(3) functions.
      
      The argv[] conversion allows to use the TAB filename completion done
      by the shell on command line.  It tolerates other tools which use
      readdir() to feed decomposed file names into git.
      
      When creating a new git repository with "git init" or "git clone",
      "core.precomposedunicode" will be set "false".
      
      The user needs to activate this feature manually.  She typically
      sets core.precomposedunicode to "true" on HFS and VFAT, or file
      systems mounted via SAMBA.
      Helped-by: NJunio C Hamano <gitster@pobox.com>
      Signed-off-by: NTorsten Bögershausen <tboegi@web.de>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      76759c7d
  15. 27 6月, 2012 1 次提交
    • J
      index-pack: Disable threading on cygwin · c0f86547
      Junio C Hamano 提交于
      The Cygwin implementation of pread() is not thread-safe since, just
      like the emulation provided by compat/pread.c, it uses a sequence of
      seek-read-seek calls. In order to avoid failues due to thread-safety
      issues, commit b038a610 disables threading when NO_PREAD is defined.
      (ie when using the emulation code in compat/pread.c).
      
      We introduce a new build variable, NO_THREAD_SAFE_PREAD, which allows
      use to disable the threaded index-pack code on cygwin, in addition to
      the above NO_PREAD case.
      Signed-off-by: NRamsay Jones <ramsay@ramsay1.demon.co.uk>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c0f86547
  16. 26 6月, 2012 1 次提交
  17. 21 6月, 2012 2 次提交
    • J
      Makefile: fold MISC_H into LIB_H · b8ba6292
      Jeff King 提交于
      We keep a list of most of the header files in LIB_H, but
      some are split out into MISC_H. The original point
      of LIB_H was that it would force recompilation of C files
      when any of the library headers changed. It was
      over-encompassing, since not all C files included all of the
      library headers; this made it simple to maintain, but meant
      that we sometimes recompiled when it was not necessary.
      
      Over time, some new headers were omitted from LIB_H, and
      rules were added to the Makefile for a few specific targets
      to explicitly depend on them. This avoided some unnecessary
      recompilation at the cost of having to maintain the
      dependency list of those targets manually (e.g., d349a03e).
      
      Later, we needed a complete list of headers from which we
      should extract strings to localized. Thus 1b8b2e4d introduced
      MISC_H to mention all header files not included in LIB_H,
      and the concatenation of the two lists is fed to xgettext.
      Headers mentioned as dependencies must also be manually
      added to MISC_H to receive the benefits of localization.
      
      Having to update multiple locations manually is a pain and
      has led to errors. For example, see "git log -Swt-status.h
      Makefile" for some back-and-forth between the two locations.
      Or the fact that column.h was never added to MISC_H, and
      therefore was not localized (which is fixed by this patch).
      Moreover, the benefits of keeping these few headers out of
      LIB_H is not that great, for two reasons:
      
        1. The better way to do this is by auto-computing the
           dependencies, which is more accurate and less work to
           maintain. If your compiler supports it, we turn on
           computed header dependencies by default these days. So
           these manual dependencies are used only for people who
           do not have gcc at all (which increases the chance of
           them becoming stale, as many developers will never even
           use them).
      
        2. Even if you do not have gcc, the manual header
           dependencies do not help all that much.  They obviously
           cannot help with an initial compilation (since their
           purpose is to avoid unnecessary recompilation when a
           header changes), which means they are only useful when
           building a new version of git in the working tree that
           held an existing build (e.g., after checkout or during a
           bisection). But since a change of a header in LIB_H
           will force recompilation, and given that the vast
           majority of headers are in LIB_H, most version changes
           will result in a full rebuild anyway.
      
      Let's just fold MISC_H into LIB_H and get rid of these
      manual rules. The worst case is some extra compilation, but
      even that is unlikely to matter due to the reasons above.
      
      The one exception is that we should keep common-cmds.h
      separate. Because it is generated, the computed dependencies
      do not handle it properly, and we must keep separate
      individual dependencies on it. Let's therefore rename MISC_H
      to GENERATED_H to make it more clear what should go in it.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      b8ba6292
    • J
      Makefile: sort LIB_H list · fc890030
      Jeff King 提交于
      This was mostly sorted already, but put things like
      "cache-tree.h" after "cache.h", even though "-" comes before
      "." (at least in the C locale). This will make it easier to
      keep the list sorted later by piping it through "sort".
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      fc890030
  18. 07 6月, 2012 1 次提交
  19. 04 6月, 2012 1 次提交