Pick over the rice if necessary and put in a bowl. Wash in several changes of water. Drain. Pour 5 cups water over the rice and let it soak for 30 minutes. Leave to drain in a strainer for 20 minutes.
Put the oil in a heavy-bottomed pot and set over medium heat. When hot, put in the onion. Stir and fry until the onion bits have browned lightly. Add the rice, green chili, garlic, garam masala and salt. Stir gently for 3-4 minutes until all the grains are coated with oil. If the rice begins to stick to the bottom of the pot, turn the heat down slightly.
Now pour in the chicken stock and bring the rice to a boil. Cove with a very tight-fitting lid, turn heat to very, very low, and cook for 25 minutes. At this point I put mine in my rice cooker instead.
Note: I couldn't get fresh green chilis, so I used half a fresh Jalepeno pepper instead.