All of lore.kernel.org
 help / color / mirror / Atom feed
* Strange diff-index output
@ 2015-11-02 23:59 Ch'Gans
  2015-11-03  0:27 ` David Turner
  0 siblings, 1 reply; 4+ messages in thread
From: Ch'Gans @ 2015-11-02 23:59 UTC (permalink / raw)
  To: git

Hi there,

We're using a script to verify that what we are building is clean
against our git repository, for this we're using "git rev-parse
--short HEAD" to get the current hash and "git diff-index --quiet
HEAD" to check for local modification.
This script works fine on developer's machines, but doesn't on our CI
system (Atlassian Bamboo/Stash).

HEAD points to refs/heads/FIX-XYZ and refs/heads/FIX-XYZ exists.

On our CI, the output of diff-index gives something like:
:100644 100644 abcdef 000000 M file1

Our problem is very likely related with how Bamboo works and/or how we
use it, but to investigate this issue further, I first would like to
understand the meaning of the above output.

>From the man page of diff-index:
- 100644 is the mode of "src"
- 100644 is the mode of dst
- abcdef is the hash of src
- 000000 is the hash of dst
- M stands for "Modified"
- file1 is the filename being considered.

>From my understanding, src here means the file system and dst the git
object. So the above should mean "file1" is new and out of sync with
the index, which doesn't make sense since "file1" is definitely in the
repository. The weird stuff is that diff-index report the same problem
on every single file no just a few!

Notes:
 - Something I've noticed with Bamboo is that the cloned repository
doesn't have any remotes. Although I'm not sure if it is relevant
here.
 - I have tried with "shallow copy" Bamboo option enabled or not and I
get the same problems
 - I have tried "git update-index", but still get the same results
 - git log still gives me the full log history (but no remote heads)
 - git status reports nothing else than a couple of generated files
 - git status HEAD reports that the working directory is clean
 - git diff-index --cached reports nothing

Does any of you have ever come across this kind of problem? Could
anyone shed some light on what's going on with our clone? Any
documentation point out or hints appreciated.

Thanks,
Chris

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

end of thread, other threads:[~2015-11-04  6:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-02 23:59 Strange diff-index output Ch'Gans
2015-11-03  0:27 ` David Turner
2015-11-03  1:00   ` Ch'Gans
2015-11-04  6:38     ` Jeff King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.